+ 1

What is the use of document.getelementById?

14th Jul 2020, 6:01 AM
Arunkumaran V
3 Answers
+ 1
Select specific tag element of html .Example:- <p id="hello"></p> In js var a=document.getElementById("hello"); a.innerHTML=document.write("My name"); .It will call p tag using id attribute and then manipulate it to finally print My name.
14th Jul 2020, 2:05 PM
shubham kumar
shubham kumar - avatar
+ 7
Kumaran it's document.getElementById() You can go to: https://www.w3schools.com/jsref/met_document_getelementbyid.asp Hope this helpful! Programming is fun! 😄
14th Jul 2020, 6:10 AM
WenHao1223
WenHao1223 - avatar
+ 7
Kumaran rmb that js is case sensitive😄
14th Jul 2020, 6:11 AM
WenHao1223
WenHao1223 - avatar