代码编辑器:
x
1
E-mail: <input type="email" id="myEmail" disabled>
2
<p>点击按钮查看 email 字段是否已禁用</p>
3
<button onclick="myFunction()">点我</button>
4
<p id="demo"></p>
5
<script>
6
function myFunction() {
7
var x = document.getElementById("myEmail").disabled;
8
document.getElementById("demo").innerHTML = x;
9
}
10
</script>
11