how to change the style of select options based on their value which is in an array
Hi,
I have a drop down list:
<select id="s">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
</select>
What I want to do is style the options based on if their value is in an array. So if I have
var sels = '1,3';
I want something like (pseudo)
$(s option).select[value in sels].css({'color' :'red'}) ;
Thanks in advance for help.
T.
ps: I know I could just do a .each but I just wanted to know if there was a one liner.