Today I found a strange jquery selector in the following code:
$(this).find("+div.parent").hide();
I’ve searched this in Jquery API and only found what pre_element+next_element means.What does the + do in the code?
Thanks.
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 selector + matches the element that follows the previous one
for example if you want to matches all the
divs that are after bold text you can use this selector:so if
$(this)is reference to<b>:will match all the
divwith classparentthat are immediately after<b>