|
HTML DOM id Property
Complete Button Object Reference
Definition and Usage
The id property sets or returns the id of the button.
Syntax
Example
This example alerts the id of the button:
<html>
<head>
<script type="text/javascript">
function alertValue()
{
alert(document.getElementById("myButton").value)
}
</script>
</head>
<body>
<form>
<input type="button" value="Click me!" id="myButton"
onclick="alertValue()" />
</form>
</body>
</html>
|
|
Try-It-Yourself Demos
Alert id, type, and value of a Button + disable button
Complete Button Object Reference
 |
W3Schools' Online Certification Program
The perfect solution for professionals who need to balance work, family, and career building.
More than 3500 certificates already issued!
|
The HTML Certificate documents your knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
|