zoukankan      html  css  js  c++  java
  • js中disabled属性

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    <html>

     <head>  

    <title> New Document </title>  

    <meta name="Generator" content="EditPlus">  

    <meta name="Author" content="">  

    <meta name="Keywords" content="">  

    <meta name="Description" content="">  

    <script>     

    function  selectAll(){         

    for ( var  i = 0 ; i <document.getElementById("td1").childNodes.length; i ++ ){             

    var  obj  =  document.getElementById("td1").childNodes[i];             

    if (obj  &&  obj.type  &&  obj.type  ==   "checkbox" )

    obj.disabled  = true   ;        

    }    

    }

    </script>  

    </head>

     <body>  

    <table  border =1  cellpadding =0  cellspacing =0  width =300>     

    <tr>         

    <td  id ="td1">             

    <input  type ="button"  value = click  onclick ="selectAll()"><br>             

    <input  type ="checkbox"> 1 <br>             

    <input  type ="checkbox"> 2 <br>             

    <input  type ="checkbox"> 3 <br>             

    <input  type ="checkbox"> 4 <br>             

    <input  type ="checkbox"> 5 <br>             

    <input  type ="checkbox"> 6 <br>             

    <input  type ="checkbox"> 7 <br>         

    </ td>     

    </ tr>     

    <tr>         

    <td  id =td2>             

    <input  type ="checkbox"> 11 <br>             

    <input  type ="checkbox"> 12 <br>         

    </ td>     

    </ tr>

    </ table>  

    </body>

    </html>

  • 相关阅读:
    nodejs设置NODE_ENV环境变量(2)
    CentOS6.8系统安装Node
    mongodb3.X权限配置
    在centos7中添加一个新用户并授权
    CentOS 7.0启用iptables防火墙
    Nginx编译参数大全 configure参数中文详解
    Linux(centos)系统各个目录的作用详解
    CentOS 6.5_X64下安装MongoDB数据库
    vue-cli 发布(译)
    Linux下的crontab定时执行任务命令详解
  • 原文地址:https://www.cnblogs.com/bailuobo/p/2545030.html
Copyright © 2011-2022 走看看