Looking for help with this code structure:
Here's the HTML:
<div class="container">
<button class="a">Button</button>
<div class="b" hidden="hidden">Content</div>
</div>
<div class="container">
<button class="a">Button</button>
<div class="b" hidden="hidden">Content</div>
</div>
And here's the jQuery code:
$(document).ready(function () {
$('.a').click(function () {
if ($('.b').is(":visible")) {
$('.b').hide();
} else {
$('.b').show();
}
return false;
});
});
How can I modify this to only show the div that was clicked on?