I have some question about jquery selection. In my case, how to match if the option.value
equal something, mark a selected
for it. Online code here
You have a typo and to set the option as selected you should use prop() and not attr(). in any case you could do
var num = 3;
$("div#selection select.select option[value="+num+"]").prop("selected", true);
fiddle here http://jsfiddle.net/YRBrp/
EDIT - the typo of course is what Tim S. pointed out, you should use $(this).val()
and not (this).val()