I've been at this on and off for a week but it never seems to work quite right.
Basically I have multiple divs that are hidden preceded by a button before each one but it has to start hidden on load. All I want is any of the buttons to only open the div directly after it. At the moment it seems to want to open all of them.
Here is the snippet of code:
<div class="buttonClass"><button class="ForumButton" type="button">Click to open</button></div><div class="forumPaster">Hidden information</div>
Here's what I have so far:
Code:
$(document).ready(function() {
$(".forumPaster").hide();
$(".ForumPasteButton:button").bind('click', function() {
$(".forumPaster").each(function(){
$(this).toggle();
});
});
});
Nothing. It still wants all of them. I can't seem to find anything that says only the next one only.