jQuery open select by button

前端 未结 7 1105
小蘑菇
小蘑菇 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 16:03

    This worked for me

    $('select').focus();

    0 讨论(0)
提交回复
热议问题