<input type="button" value="开始上传" id="idBtnupload" disabled="disabled" />
<input type="button" value="全部取消" id="idBtndel" disabled="disabled" />
disabled 属性 -- 表示已经失效的输入域(框)
引用网址:http://www.dreamdu.com/xhtml/attribute_disabled/
示例
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> </head> <body> <form id="dreamduform" action="dreamdu.php" method="post"> <label for="fav">计算机</label> <input type="checkbox" value="1" id="fav" name="fav" /> <label for="fav">旅游</label> <input type="checkbox" value="2" id="fav" name="fav" disabled="disabled" /> <label for="fav">购物</label> <input type="checkbox" value="3" id="fav" name="fav" /> </form> </body> </html>
定义和用法
disabled 属性可设置或返回是否禁用 checkbox。
语法
checkboxObject.disabled=true|false实例
下面的例子禁用了该 checkbox:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <script type="text/javascript"> function disable(){ document.getElementById("check1").disabled = true } </script> </head> <body> <form> <input type="checkbox" id="check1" /> <input type="button" onclick="disable()" value="Disable Checkbox" /> </form> </body> </html>