tags:

views:

22

answers:

3

what type of values given to getElementById() method

+1  A: 

getElementById expects a string.

The following code:

var element = document.getElementById('myId');

finds the following element and assigns it to element

<div id="myId"></div>
David Hedlund
A: 

a single DOM object, of a specialized class depending on the nature of the element identified by the given ID

streetpc
+1  A: 

just pass the id of any element like <input type="text" id="text" /> just use getElementById("text")

Richa