Radio disabled 属性

实例
禁用单选框按钮:
<form> 猫:<input type="radio" name="pet" id="cats"><br> 狗: <input type="radio" name="pet" id="dogs"> </form> <p>单击下面的按钮禁用第一个单选框。</p> <button onclick="disableElement()">禁用单选框按钮</button> <script> function disableElement() { document.getElementById("cats").disabled = true; } </script>
定义和用法
disabled 属性可设置或返回是否禁用单选按钮。
被禁用的元素既不可用,也不可点击。可以设置 disabled 属性,直到满足某些其他的条件为止(比如选择了一个复选框等等)。
语法
Set the disabled property:
element.disabled = true | false
Return the disabled property:
element.disabled
浏览器支持
所有主要浏览器都支持 disabled 属性
