14.2.4 disabled属性.html
来自「javascript即用即差核心对象手册」· HTML 代码 · 共 24 行
HTML
24 行
<form name="frm" >
姓名<input type="text" name="username" />
年龄<input type="text" name="userage" size="4"/><br />
性别<input type="radio" value="1" name="usersex" checked="checked">男
<input type="radio" value="0" name="usersex">女<br>
<input type="button" value="确定" >
<input type="reset" value="重添">
</form>
<form>
<input type="button" name="btn" value="设置为不可用" onclick="changAble()" />
</form>
<script>
function changAble()
{
document.frm.disabled= !document.frm.disabled;
if(document.frm.disabled)
document.forms[1].btn.value="设置为可用"
else
document.forms[1].btn.value="设置为不可用";
}
</script>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?