Examveda
Examveda

How to pick a document element based on the value of its id attribute?

A. getElementsbyId()

B. getElementbyId()

C. both getElementsbyId() and getElementbyId()

D. none of the mentioned

Answer: Option B

Solution(By Examveda Team)

The Document object has important methods such as getElementById(), which returns a single document element (representing an open/close pair of HTML tags and all of the content between them) based on the value of its id attribute.

Join The Discussion

Comments ( 1 )

  1. Hlobisile Shabangu
    Hlobisile Shabangu :
    3 years ago

    The correct answer is: D - None of the mentioned

Related Questions on Server Side and Client Side Scripting