Home >Web Front-end >JS Tutorial >Select the checkbox button to be grayed out otherwise the button is available_javascript skills

Select the checkbox button to be grayed out otherwise the button is available_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:47:101883browse
复制代码 代码如下:

<html> <br><head> <br><script> <br>function asd(){ <br>var reg=document.getElementsByName("reg"); <br>if(reg[0].checked){ <br>document.getElementById("submit").disabled=false; <br>} <br>else { <br>document.getElementById("submit").disabled=true; <br><br>} <br>} <br></script> <br><br></head> <br><body> <br><input name="reg" type="checkbox" onclick="asd();" />阅读了吗? <br><input type="submit" value="注册" id="submit" disabled/> <br></body> <br></html>




 
 
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn