NIELIT O Level Exam

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 मेथड का इस्तेमाल किया जाता है?

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
Latest Current Affairs 2026 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad