MCQ Answer

Which JavaScript method is used to access an HTML element by id?

Which JavaScript method is used to access an HTML element by id?

ID के ज़रिए HTML एलिमेंट को एक्सेस करने के लिए किस JavaScript मेथड का इस्तेमाल किया जाता है?
Topic : JS DOM Manipulation

A. getElement(id)

B. getElementById(id)

C. getElementById()

D. elementById(id)




Correct Answer is :

B. getElementById(id)



Explanation
In JavaScript, the method document.getElementById(id) is used to access an HTML element using its 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