Navigating the DOM
This lesson will cover essential testing on DOM navigation in terms of both theory and code analysis. Let's begin!
Question 1:
Technical Quiz
1.
Select all the node properties that can be used to navigate between nodes. Multi-select
A.
parentNode
B.
childNodes[nodenumber]
C.
firstChild
D.
lastChild
E.
nextSibling
F.
previousSibling
1 / 1
Question 2:
Study the following code:
<html><body><h1 id="heading">Educative - Interactive Courses</h1><p id="para"></p><script>document.getElementById("para").innerHTML = document.getElementById("heading").innerHTML;</script></body></html>
Child Nodes and Node Values
1.
What does the above code do?
A.
retrieves the text of an <h1>
element and copies it into a <p>
element
B.
retrieves the text of a <p>
element and copies it into an <h1>
element
C.
retrieves the id of an <h1>
element and assigns it to a <p>
element
D.
retrieves the id of a <p>
element and assigns it to an <h1>
element
1 / 1
Question 3:
Study the ...