JSFiddle - React, Tailwind, and code Playground
HTML
<button id='but_1' onclick="javascript:invert();">Invert</button>
JavaScript
function invert(){
document.getElementById('html')
alert( div.innerHTML )
}
<button id='but_1' onclick="javascript:invert();">Invert</button>
function invert(){
document.getElementById('html')
alert( div.innerHTML )
}