JavaScript | DOM and BOM | Question 1

Last Updated :
Discuss
Comments

Which method is used to select an element by its ID?

getElementByClass()

getElementById()

querySelectorAll()

getById()

Share your thoughts in the comments