zoukankan      html  css  js  c++  java
  • <head> 中的 JavaScript 函数

    <!DOCTYPE html>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <meta charset="utf-8" />
    <script src="jQuery/jquery-2.2.0.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet"href="bootstrap/css/bootstrap.min.css" />
    <script>
    //function myFunction() {
    // document.getElementById("demo").style.backgroundColor ="red"
    //}
    $(document).ready(function () {
    $("#demo").click(function () {
    document.getElementById("demo").style.backgroundColor = "red";
    })
    })
    </script>
    </head>
    <body>
    <div class="container"style="padding:50px">
    <h3>&lt;head&gt;中的 JavaScript</h3>
    <hr />
    <div onclick="myFunction()" id="demo">点击改变div元素的背景颜色</div>
    </div>
    </body>
    </html>

  • 相关阅读:
    模板
    2019牛客暑期多校训练营(第五场)
    Codeforces
    Codeforces
    SCUT
    模板
    Codeforces
    2019 Multi-University Training Contest 4
    Codeforces
    Codeforces
  • 原文地址:https://www.cnblogs.com/melao2006/p/5135730.html
Copyright © 2011-2022 走看看