Im attempting to add a checked
attribute in an input field in javascript that will be outputted as html
Here is my line..
var checked = ( <?php echo $original_delivery_date; ?> == json['dates_per_zone'][i]) ? "checked" : "";
I have verified that both json['dates_per_zone'][i]
and $original_delivery_date
are correct and displaying, but nothing is appearing.
Is that the correct syntax?
My final line is then...
html += '<input ' + checked + ' name="delivery_date" value="' + json['dates_per_zone'][i] + '">