How to reset a select element with jQuery

后端 未结 15 1845
清歌不尽
清歌不尽 2020-12-24 10:37

I have


                        
    
提交评论

  • 2020-12-24 11:23

    I believe:

    $("select option:first-child").attr("selected", "selected");
    
    0 讨论(0)
  • 2020-12-24 11:24

    This does the trick, and works for any select.

    $('#baba').val($(this).find('option:first').val());
    
    0 讨论(0)
  • 提交回复
    热议问题