Report Bug

QusWhich method is used to find an HTML element by its ID? Qusकिसी HTML तत्व को उसकी आईडी द्वारा खोजने के लिए किस विधि का उपयोग किया जाता है?


A. getElementByTagName()
B. getElementById()
C. getElementByClass()
D. querySelector()


Solution
B. getElementById()



Explanation
The getElementById() method is the most commonly used method to access an HTML element by its unique id attribute. It returns a single element that matches the given ID.
Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 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 Best Website and Software Company in Allahabad