async function test (){ document.body.innerHTML = await "<foo id='successGetID'>Hello Wolrd</foo>"; var init = await document.getElementsByTagName("foo")[0].id; alert( init ); } test();