Reputation: 35992
I saw the following usage of jQuery selector:
$('[value=""]', event.target).remove();
I can guess the meaning of this statement is to remove the option value="" from the selector event.target.
The pattern looks like $(A, B). What kind of selector rule is used here in jQuery?
Thank you
Upvotes: 0
Views: 68
Reputation: 5715
That snippet will remove all the elements which have the empty attribute value, descendants of the event.target element.
Example, removing all the links on the stackoverflow listing page:
jQuery('a', jQuery('#question-mini-list')).remove()
Upvotes: 1
Reputation: 887807
See the documentation.
This code passes the context
parameter, meaning that it will search only the children of the second parameter.
It's equivalent to $(event.target).find('[value=""]')
Upvotes: 3