I am trying to display a div code based on if statement is 0 or 1 Where 0 is false(not displaying), 1 is true(displays div).
Could you let me know what am I doing wrong?
<?php
if(ann($conn) == "1"){
echo "<script type="text/javascript">$('#ann').show()</script>";
} else {
echo "<script type="text/javascript">$('#ann').hide()</script>";
}
?>
<div id="ann" class="inside">
<h4 id="headline-3-17" class="ct-headline"><b>Announcement: </b>Website is under construction & might have design issues. <a href="/">Use This</a> if you have any issues on this website.</h4>
</div>
I tried echoing any other text and it worked also based on the if statement, but don't know how to make it so it shows or hides an existing div section.