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?
Try this
<?php if (some condition): ?>
$('#myID').show();
<?php endif; ?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With