I am wondering if there is a way to do give a jQuery selector two objects for context. The following snippet works but lacks a certain finesse in its syntax.
jQ('#some_id_or_selector', first_jQ_obj.add(second_jQ_obj) )
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.
Try using comma separated context like below,
or Simply,
DEMO: http://jsfiddle.net/ud4MU/ and http://jsfiddle.net/ud4MU/1/
Note: If it is some ID in your selector, then you can select the element by ID as
$('#some_id')instead of using any context.Since you have jQuery objects you can do like below,
DEMO: http://jsfiddle.net/ud4MU/3/