try this one:
$("h3").click(function(){
$(this).siblings("div").hide();
$(this).next().show();
});
to your second question this one(show all of them if click again):
$("h3").click(function(){
if($(this)[0].getAttribute("DivShown")== "true")
{
$(this).siblings("div").show();
$(this)[0].setAttribute("DivShown","false");
}
else
{
$(this).siblings("div").hide();
$(this).next().show();
$(this)[0].setAttribute("DivShown","true");
}
});
*this code looks pretty awful, just a tricky way to solve this.
this specifically works for the order of your html elements
(all <h3>
and <div>
are brothers and all <div>
are text to a <h3>
)
so you hide all brother <div>
then show the next one to the current <h3>