JSFiddle - React, Tailwind, and code Playground

by Afzaal Ahmad Zeeshan

HTML

<div class="txt"> <p>hi </p></div>

JavaScript

var txt = document.getElementsByTagName("div")[0].innerHTML; if (txt != null ) { document.write("There is content in that div"); } else { document.write("There is NO content in that div"); }