get element by id html
snippet in html

js getelementbyid

user8998

document.getElementById("some_id");

javascript get element by id

user384

var myElement=document.getElementById("someElementID");

get HTML text by id

user5153


 var x =
 document.getElementById("myBtn").textContent; 

get element by id html

user1773


 document.getElementById("demo");