Set the selected index of a Dropdown using jQuery

后端 未结 10 790
离开以前
离开以前 2020-11-30 17:49

How do I set the index of a dropdown in jQuery if the way I\'m finding the control is as follows:

$(\"*[id$=\'\" + originalId + \"\']\") 

I

10条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 18:42

    Select 4th option

    $('#select').val($('#select option').eq(3).val());
    

    example on jsfiddle

提交回复
热议问题