How do I programmatically set the value of a select box element using JavaScript?

后端 未结 17 1896
轮回少年
轮回少年 2020-11-22 06:33

I have the following HTML

17条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-22 06:47

    You most likely want this:

    $("._statusDDL").val('2');
    

    OR

    $('select').prop('selectedIndex', 3); 
    

提交回复
热议问题