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>

  • 相关阅读:
    C# 文件压缩与解压(ZIP格式)
    sqlite 报 no such table 错误
    又一次的轮回
    什么是数据结构
    紧张繁忙的一周
    《编程匠艺》读书笔记之十九
    [转]软件开发者面试百问
    关于学习设计模式的一些废话
    雷人的山寨版搜索引擎
    [转]Struts 2.1发布
  • 原文地址:https://www.cnblogs.com/bailuobo/p/2545030.html
Copyright © 2011-2022 走看看