$("#unit option").each(function () { var val = $(this).val(); var text = $(this).text(); if(val=="${model.unit}"){ $(this).attr("selected",true); }