Question 32 What will the webpage contain after executing the JavaScript? <!DOCTYPE html> <html> <title&g
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Question 32 What will the webpage contain after executing the JavaScript? <!DOCTYPE html> <html> <title&g
Question 32 What will the webpage contain after executing the JavaScript? <!DOCTYPE html> <html> <title>DOM Example</title> <body> <p id="ex" hidden>Paragraph with ID. </p> <p name="ex" hidden>Paragraph with name </p> <p class="ex" hidden>Paragraph with class</p> <p type="ex" hidden>Paragraph with type </p> <span id="example"></span> <script> let element = document.querySelectorAll("p.ex"); document.getElementById("example").innerHTML = "The paragraph is : "+ element[0].innerHTML; </script> </body> </html> The paragraph is : Paragraph with class The paragraph is: Paragraph with ID The paragraph is: Paragraph with name The paragraph is: Paragraph with type