Search code examples
javascriptjquerytwitter-bootstrapmulti-selectbootstrap-multiselect

Getting all options in a multiselect


I am using bootstrap-multiselect and I want to get all the options (not just selected ones) for a given multiselect. I know I can get the selected ones using the following code:

var options = $('#myMultiselect option:selected');

But I am not sure how to get ALL the options and not just selected ones.

Effectively, I want to dynamically modify the list of options based on some event and thus want to get hold of the list so that I can modify it.


Solution

  • var options = $('#myMultiselect option');