Example:
HTML
<!DOCTYPE html>
<html>
<body>
<p id="Demo">This is paragraph 1.</p>
<p id="demo">This is paragraph 2.</p>
<script>
// Only paragraph 2 will be overwritten
document.getElementById("demo").innerHTML = "HELLO.";
</script>
</body>
</html>
Example of Accessing HTML Elements with JavaScript | HTML Style Guide |
Full Example of Accessing HTML Elements with JavaScript | HTML Style Guide |
Type: | Html |
Category: | Web Tutorial |
Sub Category: | HTML Style Guide |
Uploaded by: | Admin |