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>


查看全文
  • 相关阅读:
    XP系统忘记密码解决方法
    实现一个简易的IoC框架(上)(此篇与Spring.NET无关,为自己手写IoC框架)
    Spring.NET教程(三)——对象的创建(基础篇)
    Spring.NET教程(二)——环境搭建(基础篇)
    Spring.NET教程(一)——控制反转(依赖注入)(基础篇)(转)
    递归与迭代
    软件研发人员考核的十项基本原则(转)
    ORACLE多表关联的update语句
    软件质量的分层控制方法
    技术研究与工程开发(转)
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10927015.html
  • Copyright © 2011-2022 走看看