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
option.value
selected
Your code works well. Just update 'this' with $(this). If there are no any other select dropdowns you can omit 'div#selection select.' like below.
$(document).ready(function(){ var num = 3; $("select option").each(function(){ if($(this).val()==num){ $(this).attr("selected","selected"); } }); });