问题
I'm using selectize, and I want to show a few options without clicking selectize input. So I use $('.selectize-input').click()
but it doesn't work. How to show a few options without clicking input?
回答1:
Assuming that you bind selectize plugin something like $('.selectize-input').selectize(options)
, you should be able to use API's open method like this:
$('.selectize-input')[0].open();
来源:https://stackoverflow.com/questions/31687392/how-to-trigger-selectize-input-to-make-options-shown-initially