实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<form>
6
Buttons:
7
<input type="button" id="firstbtn" value="OK">
8
<input type="button" id="secondbtn" value="OK">
9
</form>
10
11
<p>Click the button below to disable the first button above.</p>
12
13
<button onclick="disableElement()">Disable button</button>
14
15
<script>
16
17
function disableElement()
18
{
19
document.getElementById("firstbtn").disabled=true;
20
}
21
22
</script>
23
</body>
24
</html>