🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: DOM and Events: all 10 questions

Quiz: DOM and Events · Question 8 of 10

Which pair of methods creates a new <li and puts it at the end of a list?

Which pair of methods creates a new <li> and puts it at the end of a list?

  1. A.document.querySelector and remove
  2. B.document.createElement("li") and list.append(li)
  3. C.addEventListener and preventDefault
  4. D.innerText and textContent
Answer & explanation

Correct answer: document.createElement("li") and list.append(li)

createElement builds the node; append (or appendChild) adds it to the DOM.

Can you get the rest right without peeking?

Take the timed Quiz: DOM and Events quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →