|
|
Using "untidy" HTML code can result in JavaScript errors. These two JavaScript statements will produce different results: |
<script>
// Only paragraph 2 will be overwritten
document.getElementById("demo").innerHTML = "HELLO.";
</script><!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>
Category: | Web Tutorial |
Sub Category: | HTML Style Guide |
Uploaded by: | Admin |
Read Articlehttps://develop.horje.com/learn/1434/reference