I would like to use jQuery to check if a div has any text in it. if it does then show the div otherwise hide it.
for example:
<div id="demo_div"></div>
<script>
$( document ).ready(function() {
if ($("#demo_div") has some text) {
$("#demo_div").show();
}
else
{
$("#demo_div").hide();
}
});
which jQuery function should I use to detect if the div has text inside?
Thank you!