Qusआप जावास्क्रिप्ट में किसी तत्व को उसके टैग नाम से कैसे एक्सेस कर सकते हैं?
A. document.getElementByTagName()
B. document.getElementsByTagName()
C. document.querySelectorAll()
D. document.tagName()
Solution
B. document.getElementsByTagName()Explanation
The getElementsByTagName() method returns an HTMLCollection of all elements with the specified tag name. It allows you to select multiple elements of the same type (e.g., all elements).