1var element = document.getElementById("YourElementId");
2var value_element = document.getElementById("YourElementId").value;
1All currently used browsers:
2element.id=id;
3myElement.id=newId;
4
5element.className=class;
6myElement.className=newClassName;
7
8
1async function test (){
2 document.body.innerHTML = await "<foo id='successGetID'>Hello Wolrd</foo>";
3 var init = await document.getElementsByTagName("foo")[0].id;
4 alert( init );
5}
6test();