I have the following HTML
structure and JavaScript
file:
.html
<li>
<button class="show-more"></button>
some more elements
<div class="hidden"></div>
</li>
JavaScript
$( ".show-more" ).click(function() {
event.preventDefault();
$( this ).next().slideToggle( "fast", function() {
});
});
I need the click event to toggle the next first instance of .hidden
, however the click event is targeting the first element after it and not the next instance of .hidden
, any ideas how I can go about it?