jQuery open select by button

前端 未结 7 1107
小蘑菇
小蘑菇 2021-01-11 15:33

How to open select dropdown by button?

$(\'button\').on(\'click\', function() {
   $(\'select\').trigger(\'click\');
});

My code: http://js

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-11 15:46

    You can do it with only CSS like this:

    
    
    
    

    Visit this fiddle for more details: https://jsfiddle.net/ssjuma/1mkxw2nb/1/

提交回复
热议问题