JSFiddle - React, Tailwind, and code Playground

by Tintu Raju

HTML

<input type='button' onclick='clear_div()' value='click me'>
    <div id='txx'>Some text</div>

JavaScript

function clear_div() {
    alert('i will work ');
    var clear_div="";
    // This will not work
    document.getElementById('txx').innerHTML = clear;
}