• 10 hours
  • Medium

Free online content available in this course.

course.header.alt.is_video

course.header.alt.is_certifying

Got it!

Last updated on 4/2/20

Manipulate the DOM

Evaluated skills

  • Access and modify DOM elements
  • capture DOM events
  • Question 1

    Which of the following functions will return a collection containing all  <p>  nodes within the document?

    • Both  document.getElementsByTagName('p');  and  document.querySelectorAll('p');

    • Both  document.getElementsByClassName('p');  and  document.getElementById('p');

    • Only  document.querySelector('p');

  • Question 2

    Select the three functions below which will return the paragraph  <p>  with id  main-article .

    Careful, there are several correct answers.
    • document.getElementsByTagName('main-article');

    • document.getElementById('main-article');

    • document.querySelector('p#main-article');

    • document.querySelector('p.main-article');

    • document.querySelector('#main-article');

  • Question 3

    Which of the following functions will return a collection containing all  <li>  nodes (and ONLY  <li>  nodes) of class  list-item-active  ?

    • document.getElementById('list-item-active');

    • document.querySelectorAll('li.list-item-active');

    • document.getElementsByClassName('list-item-active');

    • document.querySelector('li.list-item-active');

Ever considered an OpenClassrooms diploma?
  • Up to 100% of your training program funded
  • Flexible start date
  • Career-focused projects
  • Individual mentoring
Find the training program and funding option that suits you best