最后更新于:2022-03-26 22:23:18
Input Button disabled 属性
Input Button 对象
实例
实例 1
禁用一个按钮:
<script>
document.getElementById(“firstbtn”).disabled=true;
</script>
输出结果:
尝试一下 »
定义和用法
disabled 属性可设置或者返回按钮是否可用。
disabled 元素是不可用的即不可点击。禁用元素在浏览器中通常呈现在灰色。
语法
设置 disabled 属性:
element.disabled=true|false
返回 disabled 属性:
浏览器支持





所有主要浏览器都支持 disabled 属性
Input Button 对象