I have been trying to get some jQuery running replacing the html of an object. But how can i put an if statement inside, like this.
$(this).html("<select id=\'status\' name=\'status[]\' multiple><option value=\'1\'"+if(string_contains(selected, 1)) { document.write(\' SELECTED\'); }+"></option></select>");
The if statement makes it stop working.
And a little side question.
Why cant i break inside the .html like this:
$(this).html("
<select id=\'status\' name=\'status[]\' multiple>
<option value=\'1\'"+if(string_contains(selected, 1)) { document.write(\' SELECTED\'); }+"></option>
</select>");