JavaScript Get Element by ID
var element = document.getElementById("YourElementId");
Batman
var element = document.getElementById("YourElementId");
var element = document.getElementById("oldID");
element.id = "newID";
document.getElementById("YourElementId");
var element = document.getElementById("YourElementId");
var value_element = document.getElementById("YourElementId").value;
var element = document.getElementsByTagName("div")[0];
var id = element.id;
async function test (){
document.body.innerHTML = await "<foo id='successGetID'>Hello Wolrd</foo>";
var init = await document.getElementsByTagName("foo")[0].id;
alert( init );
}
test();