Reputation: 1520
How to find selected data? I have this selectize
and when I try selectize.find("#state")
it return me empty. And it only works selectize[1]
but what if I have many select cause it's dynamic, i can't make it static like selectize[4]
, how to find specified?
Upvotes: 0
Views: 32
Reputation: 816462
If you have a look at the documentation, you will read this about .find
:
Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
That's not what you want. You are not looking for a descendant with that ID, you are looking for an element with that ID among the selected elements themselves! That's what .filter
is for: .filter('#state')
.
Upvotes: 1