JavaScript and HTML
JavaScript and HTML
The HTML part of your code sets up the structure of the webpage:
<p>This example writes "Hello JavaScript!" into an HTML element with id="demo":</p>: This paragraph
describes what the JavaScript code will do.
<p id="demo"></p>: This paragraph element has an id attribute with the value "demo". This is where the
JavaScript will insert the text.
JavaScript Section
How It Works
2. The JavaScript code finds the <p> element with the id "demo".