How do I use jQuery templates to select an option?
Let's say my data is: { "color" : "red" }
I have :
<select>
<option>blue</option>
<option>green</option>
<option>red</option>
</select>
I want red to be the one that's selected by default. How can I do this?
Thanks.
Maybe not the most elegant, but here is a way to do it in your template: http://jsfiddle.net/rniemeyer/z7Uu7/