klose11
 1 <html>
 2     <head>
 3         <meta charset="UTF-8">
 4         <title></title>
 5     </head>
 6     <body>
 7         <input id="aaa" type="checkbox" onclick="check()" />
 8         <input type="button" value="下一步" id="btn" disabled="disabled"/>
 9     </body>
10 </html>
11 <script>    
12     function check(){
13         var aaa = document.getElementById(\'aaa\');
14         if(aaa.checked){
15         document.getElementById(\'btn\').removeAttribute(\'disabled\');
16     }else{
17         document.getElementById(\'btn\').setAttribute(\'disabled\',\'disabled\');
18     }
19 }
20 </script>

 

removeAttribute(\'要删除的属性\')    删除属性

setAttribute(\'属性\',\'属性值\')  添加属性

 

 

分类:

技术点:

相关文章:

  • 2021-09-08
  • 2021-08-02
  • 2021-12-29
  • 2021-08-02
  • 2021-10-15
  • 2021-08-02
  • 2021-08-02
猜你喜欢
  • 2021-08-02
  • 2021-10-19
  • 2021-11-30
  • 2021-11-30
  • 2021-09-30
  • 2021-11-17
  • 2021-11-19
相关资源
相似解决方案