Toogle Class With Jquery Not Working

Hello All, I need urgent assistance with this jquery code$("#comment_link").on("click", function(){ $(".comment_area").toggleClass("comment_show"); });

it works fine but i have more than one element with that CLASS NAME and if i click on one the element ie comment_link id it will affect the rest. now I know is because of the selector am using but how limit to the element that is being click.

Which area are you trying to show? You could iterate through the nodes in a specific selector. What is the structure of what you are trying to change the class?

Using JQuery Selectors

Sponsor our Newsletter | Privacy Policy | Terms of Service