zoukankan      html  css  js  c++  java
  • html 自定义属性

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>无标题页</title>
    
        <script type="text/javascript">
         function  thisTest(obj) { 
              alert(obj.getAttribute('dept'));
         }
         function showguid(){
           var a=document.getElementById("guid");
           a.onclick=function(event){ 
           alert(a.getAttribute('guid'));
           a.setAttribute('guid','5555555555555555')
           }
         }

    </script>
    
    </head>
    <body onload="showguid();">
        <form id="form1" runat="server">
        <div>
            <input type="button" name="thistest" id="thistest" value="this" guid="1111111111111111111"
                dept="总部" onclick="thisTest(this)" />
            <input type="button" guid="2222222222222" id="guid" value="guid"></input>
        </div>
        </form>
    </body>
    </html>
    

      

  • 相关阅读:
    su和sudo命令详解
    JS线程Web worker
    Navicat 批处理 自动备份数据库
    MySql【Error笔记】
    vue入门
    动态库
    环境变量
    cmake_learn
    自动编译
    网络编程
  • 原文地址:https://www.cnblogs.com/wanghk/p/2891356.html
Copyright © 2011-2022 走看看