iterate over options #1882
Unanswered
andreagosto
asked this question in
Q&A
Replies: 3 comments
-
var $select = $('select').selectize({...});
// <option> elements
var $options = $('option', $select);
// selectize options (an object)
var options = $select[0].selectize.options; |
Beta Was this translation helpful? Give feedback.
0 replies
-
Just in case anyone else finds this question while attempting to iterate over the options object. Assuming brianreavis' code above, you can iterate over the "options" variable using: Object.keys(options). |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, i can't understand how i can iterate over all options element. I'm sorry, it must be a very basic function, but maybe is not too much intuitive! can someone help me?
Beta Was this translation helpful? Give feedback.
All reactions