Hello. There are markup
<b id="idname">some_content</b> How to turn it into
<b id="idname">some_content2</b> Regular?
$("#elementID").html("another string"); In my case, it’s not completely dead Thank.
some_content How to turn it into...">
Hello. There are markup
<b id="idname">some_content</b> How to turn it into
<b id="idname">some_content2</b> Regular?
$("#elementID").html("another string"); In my case, it’s not completely dead Thank.
Well, for those who wish, play a guessing game
document.body.innerHTML = '<b id="idname">some_content</b>' void function () { let i = 0 function foo() { var idname = idname || document.getElementById('idname') let str = `some_content_${i}` let tmp_d = document.createElement('div') tmp_d.innerHTML = idname.outerHTML.replace(/(?![^>]+>)(.*)(?=<[^>]+>)/g, `>${str}`) idname.parentElement.replaceChild(tmp_d.childNodes[0], idname) i++ if (i > 20) clearInterval(intervalID) } let intervalID = setInterval(foo, 1000) }() Source: https://ru.stackoverflow.com/questions/792929/
All Articles