zoukankan      html  css  js  c++  java
  • javascript 使用方式

    版权声明:本文为博主原创文章,未经博主同意不得转载。

    https://blog.csdn.net/qilixiang012/article/details/26688393

    第一种:内嵌在html节点中

    <html>
    <body>
    
    <input type="button" onclick="document.body.style.backgroundColor='lavender';"
    value="Change background color" />
    
    </body>
    </html>


    另外一种:调用方法

    <html>
    <body>
    
    <script>
    function ChangeBackground()
    {
    document.body.style.backgroundColor="lavender";
    }
    </script>
    
    <input type="button" onclick="ChangeBackground()"
    value="Change background color" />
    
    </body>
    </html>

    第三种:导入js文件

     <script src=“url” type="text/javascript"></script>


查看全文
  • 相关阅读:
    分页工具类
    ajax乱码的问题
    ibatis配置文件中的XML解析错误The content of elements must consist of well-formed character data or markup.
    nginx 反向代理导致的session丢失的问题
    后台返回的值ajax接收不到
    C/C++中vector与list的区别
    C/C++中内存泄漏、内存溢出与野指针的解释与说明
    C++中深拷贝与浅拷贝
    C++中的构造函数与析构函数及组合类的调用
    Linux中request_irq()中断申请与处理说明
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10927015.html
  • Copyright © 2011-2022 走看看