[jQuery] Setting option with a variable as its value to selected
Hi,
I'm trying set an option with a certain value to selected. I'm using
this:
$('#mySelect option[value="' + myValue + '"]').attr('selected',
'selected');
This has worked in another piece of code I wrote, but now IE 6 and 8
are throwing an error (in the debug bar). It's something similar to
this: "The selected attribute couldn't be set. Unknown error."
Anyone ever experienced something similar?
Thanks