fabianlindfors / multi.js

A user-friendly replacement for select boxes with the multiple attribute enabled
https://fabianlindfors.se/multijs
MIT License
953 stars 76 forks source link

Preselected items #37

Closed ilovetacos closed 4 years ago

ilovetacos commented 4 years ago

Hi, thank you for the good work! I was wondering if there is a possibility to set preselected items?

GeekJosh commented 4 years ago

It is - just make sure the options are selected in the original select element before initializing multi.js and it'll preselect them

fabianlindfors commented 4 years ago

Thanks for chiming in @GeekJosh, you're totally right! If you change the selected items after multi.js has been initialized you can also trigger the change event to have them update.