MCQ Answer

How can you access an element by its tag name in JavaScript?

How can you access an element by its tag name in JavaScript?

आप जावास्क्रिप्ट में किसी तत्व को उसके टैग नाम से कैसे एक्सेस कर सकते हैं?
Topic : JS DOM Manipulation

A. document.getElementByTagName()

B. document.getElementsByTagName()

C. document.querySelectorAll()

D. document.tagName()




Correct Answer is :

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).
Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2025 Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz