For some reason some Javascript/Jquery code does not work when placing it inside PHP.
<?php
if (x > 0) {
?>
<script type="text/javascript">
alert("Hi!");
$("#fault_message_mail").hide();
</script>
<?php
} else . . .
?>
In case x>0 it is executed only the Alert and not the hide method(I'd like to hide a div declared in some html code).
Why it is not executed? Is it prudent to use jQuery inside PHP?
I've been searching similar questions in Stack overflow, however I cannot find a positive answer.
Thank you
$x>0instead ofx>0?