zoukankan      html  css  js  c++  java
  • javascript学习代码

    点击改变p和div元素:

    <!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>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>test javascript</title>
    <style type="text/css">
        body{
                margin:0px;
                padding:0px;
                background:#999999;
                }
        #button{
                border-radius:6px;
                color:#00FF00;
                font-size:16px;
                }
    </style>
    </head>
    
    <body>
    <h1>My Site</h1>
    <p id="demo">一个段落</p>
    <div id="myDIV" onclick="JavaScript:alert("hello lt")">一个div块</div>
    <button type="button" id="button" onclick="myFunction()" >click me</button>
    <script type="text/javascript">
        function myFunction(){
            document.getElementById("demo").innerHTML="Hello world!";
            document.getElementById("myDIV").innerHTML = "How are you!";
        }
    </script>
    </body>
    </html>
  • 相关阅读:
    二分查找
    二分排序
    How to use hdu?
    HGOI 20200721
    HGOI 20200720
    HGOI 20190719
    HGOI 20200716
    HGOI 20190714
    LCA 的一些扩展算法
    HGOI 20190711
  • 原文地址:https://www.cnblogs.com/blogofwyl/p/4541485.html
Copyright © 2011-2022 走看看