I'm executing a PHP if/else statement.
However, I want the code to do something like this :
<?php
if ($condition == true){
echo 'ITS TRUE!';
}else {
#id-element.css('display':'none');
}
?>
Note that the ELSE statement executes a jQuery line that changes the css style of the element involved.
How do i go about doing this?
Anyone have any suggestions / examples of how I could implement a PHP if/else and change css styles with jQuery inside the PHP if/else statement?
You can echo the HTML for a style element and throw the CSS inside that.
else {
echo '<style type="text/css">
#id-element {
display: none;
}
</style>';
}
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