Report Bug
Qus : How can you access all elements with a specific class name?
Qusआप किसी विशिष्ट वर्ग नाम वाले सभी तत्वों तक कैसे पहुंच सकते हैं?

A. document.getElementByClassName()
B. document.getElementsByClassName()
C. document.querySelectorAll(".class")
D. Both b and c


Solution
D. Both b and c



Explanation

The getElementsByClassName() method returns a collection of all elements that match a specified class name, whereas querySelectorAll(".class") returns a static NodeList of all elements matching the class.




Report Bug