I was just looking at the jQueryUI button plug-in and noticed this
$("button, input:submit, a", ".demo").button();
I never seen something like this. Is this like multiple selects in one jQuery selector?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The second argument (
".demo"in your example) is the context, basically your selector is restricted to match only descendants of a determined context:Is just equivalent to use the
findmethod:Give a look to the documentation of the jQuery function:
Also notice that the selector you post
"button, input:submit, a", is called Multiple Selector, and there you can specify any number of selectors to combine into a single result, just by separating them by a comma.