×
Complete the exercises here and get the tests to pass!
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <div class="row main sidepane"> <h1> <p class="row foo"></p> <div class="row main sidepane"> <h2> <div class="row test">1</div> </h2> </div> </h1> </div> <div class="row"> <div class="main"> <h2 class="row"> <div id="foo" class="row main sidepane"> 2 </div> </h2> </div> </div> <div class="row"></div> </body> </html>
foo
, you could use the document.getElementById
method. Try to implement that function on your own! Here are some hints:
null
if the element can not be found.document.body.children
so you start from the root of the DOM.document.getElementsByTagName
method. Try to implement that function on your own! Here are some hints:
id
, but another property.document.getElementsByClassName
method. Try to implement that function on your own! Here are some hints:
classList
and you will find a convenient method). When you're ready, move on to Dynamic Programming