HTML DOM id Property
Complete Button Object Reference
Definition and Usage
The id property sets or returns the id of the button.
Syntax
Example
The following example gets the id of the button:
<html>
<head>
<script type="text/javascript">
function alertId()
{
alert(document.getElementById("myButton").id)
}
</script>
</head>
<body>
<form>
<input type="button" value="Click me!" id="myButton"
onclick="alertId()" />
</form>
</body>
</html>
|
Try-It-Yourself Demos
Alert id, type, and value of a Button + disable button
Complete Button Object Reference
|