tryjsref_number_disabled2 在线代码实例
<input type="number" id="myNumber" value="2" disabled="">
<p>点击按钮查看 number 字段是否被禁用。 </p>
<button onclick="myFunction()">点我</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myNumber").disabled;
document.getElementById("demo").innerHTML = x;
}
</script>