![]() |
Definition and UsageThe The Applies toThe
Browser Support |
Example:
HTML
<!DOCTYPE HTML>
<html>
<body>
<h1 id="myHeader">Hello World!</h1>
<button onclick="displayResult()">Change text</button>
<script>
function displayResult() {
document.getElementById("myHeader").innerHTML = "Have a nice day!";
}
</script>
</body>
</html>
html id attribute |
How to Use the id attribute to manipulate text with JavaScript | HTML Attribute |
Read Full: | HTML Attribute |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | HTML Attribute |
Uploaded: | 6 days ago |
Uploaded by: | Admin |
Views: | 26 |
Reffered: https://www.w3schools.com/tags/att_id.asp