JSFiddle - React, Tailwind, and code Playground
Editor
by Dave
HTML
<div id="zMain">
On<font color="red">e</font>
</div>
<div id="zSpare">
Spare
</div>
<div id="zSpare2">
Spare2
</div>
<button onclick="go()">
1
</button><button onclick="go2()">
2
</button>
JavaScript
function go() {
//var text = $('#zMain').text()
//$('#zSpare').html('Hello World');
//$('#zSpare').html($('#zMain').html());
//var txt = document.getElementById("zMain").outerHTML;
//var zzSauce=$("#zMain")[0].outerHTML;
//alert(txt)
//$('#zMain').html()
$('#zMain').text($('#zMain').html());
}
function go2() {
$('#zMain').html($('#zMain').text());
}