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>


查看全文
  • 相关阅读:
    村上春树的《海边的卡夫卡》与中日现实
    熊的甜蜜世界
    VS创建dll和调用dll
    DIRECTSHOW在VS2005中PVOID64问题和配置问题
    Vs 2008 解决方案的目录结构设置和管理
    SQL Server 2008中的代码安全(二):DDL触发器与登录触发器
    如何在自动SGA管理模式下调节参数设置
    将ORACLE数据库从归档改成非归档状态
    查看oracle数据库是否归档和修改归档模式(转)
    oracle TRANSLATE函数详解
  • 原文地址:https://www.cnblogs.com/ldxsuanfa/p/10927015.html
  • Copyright © 2011-2022 走看看