HTML DOM disabled Property
Complete Button Object Reference
Definition and Usage
The disabled property sets or returns whether or not a button should be
disabled.
Syntax
buttonObject.disabled=true|false
|
Example
The following example disables the button when clicking on it:
<html>
<head>
<script type="text/javascript">
function disableButton()
{
document.getElementById("myButton").disabled=true
}
</script>
</head>
<body>
<form>
<input type="button" id="myButton"
value="Click me!" onclick="disableButton()" />
</form>
</body>
</html>
|
Try-It-Yourself Demos
Alert id, type, and value of a Button + disable button
Complete Button Object Reference
|