how to count number of options in dropdown using selectize.js?
$('#MyDrop option').length;
$('#MyDrop option').size();
Above ones are not working with selectize !
Get all options of selectize
let options = $('#selectElem')[0].selectize.options;
Get all keys of object
let count = Object.keys(options);
console.log(count.length);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With