NSCT: Web Development MCQs — Computer Science (page 5)
105 multiple-choice questions on NSCT: Web Development from Computer Science, each with the correct answer and, where available, a teacher's explanation. Read through them to revise the chapter, then practise the same questions one by one to test yourself.
101. Which method selects the first element matching a CSS selector?
window.alert()
document.querySelector()
document.getElementsByTagName()
document.write()
Answer: B) document.querySelector()
Explanation: querySelectorAll returns all matches. Lesson 6.3 · Web Development