jquery set selected for select element

//1
$("#Provider_" + counter + " option[value=" + FormData.ID + "]").attr('selected', 'selected'); //2 $("#Provider_" + counter + " option").filter(function () { return $(this).val() == FormData.ID; }).prop('selected', true); //3 $("#Provider_" + counter + " option").filter(function () { return $(this).val() == FormData.ID; }).attr('selected', true);

 

posted @ 2014-04-23 11:30  zyip  阅读(149)  评论(0编辑  收藏  举报