<select name="sel_option" id="sel_option">
<option value="1">test1</option>
<option value="2">test2</option>
<option value="3">test3</option>
</select>
- var value = 'test2';
$('#sel_option option:contains(' + value + ')').each(function(){
if ($(this).text() == value ) {
$(this).attr('selected', true);
}
});
- 选中第二项