how do i select a specific element after i’ve clicked another element in the same div?

Use JQuery.next() to select sibling of $this.

$("h3").on("click", function(){
   $(this).next("p").toggleClass("show");
});

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top