I have the following code in Javascript and Jquery:
$("<li />")
.html('Somehtml')
I would like to be able to change the content of .html by using if-else statement. My code should be something like this, however it's not working.
var showinfo = <?php echo '$action'; ?>
$("<li />")
if (showinfo == 'action1'){
.html('Somehtml')
else {
.html('Other html')
}
Any ideas how should I change it?