html 的简单运用

<p>JavaScript 能够直接写入 HTML 输出流中:</p>
<script type="text/javascript">// <![CDATA[
document.write("<h1>这是一个标题</h1>");
    document.write("<p>这是一个段落。</p>");
// ]]></script>
<p>您只能在 HTML 输出流中使用 <strong>document.write</strong>。 如果您在文档已加载后使用它(比如在函数中),会覆盖整个文档。</p>
<p>888888888888888888888888888888888888888888888888</p>

<p id="demo">我是一个镜子!!!!!!!!</p> <p><button onclick="mytest()" type="button">点击我。有惊喜 Q!</button></p> <script type="application/javascript">// <![CDATA[ function mytest(){ var xx=document.getElementById("demo") xx.style.color="#ff0000"; } // ]]></script> <p>88888888888888888888888888888888888888888888</p>

<p><video width="320" height="240" style="width: 500px; height: 300px;" controls="controls">
<
source src="video/movie.mp4" type="audio/mp4" />></source> <source src="video/movie.mp4" type="audio/vnd.rn-realaudio"></source>-->
你的浏览器不支持 video 标签。 <
/video>

588888888888888888888888888888888888888888888</p> <table border="2px" cellspacing="0px" cellpadding="0px"> <tbody> <tr><th colspan="2">这是标题</th></tr> <tr> <td>12</td> <td>12</td> <td>12</td> </tr> <tr> <td>12</td> <td>12</td> <td>12</td> </tr> </tbody> </table> <ul style="list-style: none;"> <li>1</li> <li>1</li> <li>1</li> <li>1</li> <li>1</li> </ul> <dl><dt>我司头</dt><dd>二位无</dd><dd>大概发</dd></dl> <p>88888888888888888888888888888888888</p> <script type="text/javascript">// <![CDATA[ document.write("Hello World!") // ]]></script> <noscript>抱歉,你的浏览器不支持 JavaScript!</noscript> <p>不支持 JavaScript 的浏览器会使用 &lt;noscript&gt; 元素中定义的内容(文本)来替代。</p> <p>888888888888888888888888888888888888</p> <p><iframe style="width: 100%;" name="qwe" src="table.html" width="320" height="240"></iframe></p> <!--// 引入外部资源--> <p><a href="http://www.runoob.com" target="qwe">点我!</a></p> <p><strong>注意:</strong> 因为 a 标签的 target 属性是名为 iframe_a 的 iframe 框架,所以在点击链接时页面会显示在 iframe框架中。</p>

88888888888888888888888888888
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <p id="demo">我是一个镜子!!!!!!!!</p>
        <button type="button" onclick="mytest()">点击我。有惊喜 Q!</button>
    </body>
    <script type="application/javascript">
        
        function   mytest(){
               document.getElementById("demo").innerHTML="哈哈哈哈"
            
        }
        
    </script>
</html>

猜你喜欢

转载自www.cnblogs.com/xiaowoniulx/p/9117061.html
今日推荐