itzikb itzikb - 5 months ago 13x
Javascript Question

onclick event toggle div that is exists more than 1 in different div

I uploaded my code into jsfiddle:
I'm trying to toggle the

when I click on


If u can see there is a multiple div called question, I don’t remember how to do that I am a little rusty.


You should use $(this).parent().next() instead DEMO

$("div.question").click(function() {

Also if you want to hide siblings and add slide effect you can do it like this DEMO

$("div.question").click(function() {