ID do elemento de mudança de javascript
var element = document.getElementById("oldID");
element.id = "newID";
TC5550
var element = document.getElementById("oldID");
element.id = "newID";
var element = document.getElementById("YourElementId");
var value_element = document.getElementById("YourElementId").value;
var element = document.getElementsByTagName("div")[0];
var id = element.id;
element = document.querySelector("#id");
// Get the ID from Element
let element = document.getElementById('elementId')
console.log(element.id) // Get the ID
// Get value from input Element
let element = document.getElementById('elementId')
console.log(element.value) // Get the value
async function test (){
document.body.innerHTML = await "<foo id='successGetID'>Hello Wolrd</foo>";
var init = await document.getElementsByTagName("foo")[0].id;
alert( init );
}
test();