JSFiddle - React, Tailwind, and code Playground

by Tintu Raju

HTML

<table>
    <td id='abcd'>Put some content here and try and try without any content</td>
</table>

<input type="checkbox" id="chk">

JavaScript

var td = document.getElementById("abcd");
var chk = document.getElementById("chk");
if(td.innerHTML.trim()!=""){
     chk.checked = true; 
}