HTML DOM disabled 屬性
定義和用法
disabled 屬性可設(shè)置或返回是否禁用單選按鈕。
語(yǔ)法
radioObject.disabled=true|false
實(shí)例
下面的例子禁用了該單選按鈕:
<html>
<head>
<script type="text/javascript">
function disable()
{
document.getElementById("gnome").disabled=true
}
</script>
</head>
<body>
<form>
Human: <input id="human" type="radio" name="creature" value="Human" />
<br />
Animal: <input id="animal" type="radio" name="creature" value="Animal" />
<br />
Gnome: <input id="gnome" type="radio" name="creature" value="Gnome" />
<br /><br />
<input type="button" onclick="disable()" value="Disable choice" />
</form>
</body>
</html>