当前位置:Gxlcms > JavaScript > JavaScript入门实例源码案例

JavaScript入门实例源码案例

时间:2021-07-01 10:21:17 帮助过:2人阅读

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="Scripts/common.js?1.1.11"></script>
</head>
<body>
    <div id="divFirst">
    </div>
    <div id="divSecond">
    </div>
    <div id="divThird">
    </div>
    <script type="text/javascript">
        $('divFirst').innerHTML = "<a href='http://www.baidu.com'>Go to baidu</a>";
        updateHtml('divSecond','<input type="text" value="我是文本框"/>');
        updateText('divThird','<pre>文本内容,不是HTML</pre>');
        writeHtml('同学,你好!');
        writeP("我是段落内容");
        writeTable(10, 3);
        writeHtml(getDateString());
        writeHtml("<br>");
        writeSelectList(['bmw', 'benz', 'audi']);
        writeList(['apple', 'banana', 'cat']);
    </script>
    <ul>
        <li onmouseover="setColor(this,'red')" onmouseout="setColor(this,'white')">apple</li>
        <li onmouseover="setColor(this,'red')" onmouseout="setColor(this,'white')">banana</li>
        <li onmouseover="setColor(this,'red')" onmouseout="setColor(this,'white')">cat</li>
    </ul>
</body>
</html>

以上就是JavaScript入门实例源码案例的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行