04-04-2023, 07:18 AM
The HTML part between the <body></body> tags looks like this:
The JavaScript part of the code looks like this:
Code:
<!-- Selecting elements by CSS selector -->
<div id="container">
<p class="note">This is a note</p>
<p class="note">This is another note</p>
<p class="error">An error message</p>
</div>
The JavaScript part of the code looks like this:
Code:
// Selecting elements by CSS selector
let container = document.querySelector("#container");
document.write(container);