I have a select menu, it's options are ID'd like this:
<select>
<option id='order1|2'>1</option>
<option id='order2|2'>2</option>
<option id='order3|2'>3</option>
</select>
I want to select one dynamically with jQuery. In javascript, I can do
document.getElementById("order2|2").selected=true;
and that works fine. however, with jQuery
$("#order2|2").attr("selected","selected");
gives a bad expression error, so does any other command when I am working with it, such as
$("#order2|2").val();
I'm not sure what is happening. jQuery does not like the pipe symbol? Thanks.