What is document.getElementById in javascript? What it will return?
What is document.getElementById in javascript? What it will return? Explain with an example.
Add comment
Answers (1)
Add AnswerThe function getElementById() retrieves an element with the supplied value and value mus be a Id of an element
If the element does not exist, the getElementById() function returns null.
One of the most frequent methods in the HTML DOM is getElementById().
It is nearly often used when you wish to read or update an HTML element.