November 23, 2015
$(function() { $('.button').click(function() { // jQuery.prev() $(this).prev('.hide-show').toggle(); // jQuery.next() $(this).next('.hide-show').toggle(); return false; }); });
Add additional controls if you’re using a different trigger to close the elements:
jQuery('.second_button_hide').click(function(){ jQuery('.hide-show').hide(); });
Sourced here.