Below elements second hide button is working. if I put the div to the button it is not working. With out giving the id is it possible to do so?
JavaScript
$(document).ready(function(){
$(".toggle").click(function()
{
// hides matched elements if shown, shows if hidden
$(".content", $(this).next()).toggle();
});
});
HTML
<div>
<input class="toggle" type='button' value='hide'>
</div>
<div>
<div class="content">
Content 1
</div>
</div>
<br><br>
<input class="toggle" type='button' value='hide'>
<div>
<div class="content">
Content 2
</div>
</div>
Try this