For example if body has class dummy… and in menu if li has same class… the new class should be added to li.. plz tell me how to do it in jQuery..
Share
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.
If I understood your question correctly, here’s how:
The selector
body.dummy li.dummyselects all<li>tags that have the samedummyclass as the<body>, and then add thenewclass to them.http://api.jquery.com/addClass/