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>


查看全文
  • 相关阅读:
    BootStrap 智能表单系列 五 表单依赖插件处理
    BootStrap 智能表单系列 四 表单布局介绍
    BootStrap 智能表单系列 三 分块表单配置的介绍
    LinQ.OrderBy 多个字段排序
    ABP.NET CORE 遇到的小问题
    vs2017断点无效 当前不会命中断点 已设置断点单还未绑定
    DateTime 取年月日;字符串截取
    C# DateTime 多个时间段循环相加;两个时间段求差值
    ABP.Net Core 小白使用教程 附件:ABP.NET中文文档
    ASP.NET MVC+Easyui 后台管理系统的图片上传
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10927015.html
  • Copyright © 2011-2022 走看看