I need to add a PHP condition inside some javascript code like this:
<script> $(document).ready(function() { <?php if (some condition) { $('#myID').show(); } }); </script>
Is this possible?
Advertisement
Answer
Try this
<?php if (some condition): ?> $('#myID').show(); <?php endif; ?>