I'm trying to toggle (hide/show) a table when clicking a button which is located in a different table, but have trouble selecting it correctly. I intentionnally left id tags out, as I want the jQuery code to be generic because I'll need to reuse it various times in the same script.
here is where I have got so far:
http://jsfiddle.net/Argoron/Dp2sk/24/
$(document).ready(function() {
$('button.new_disp').toggle(
function() {
$(this).closest('table').next('table').hide();
$(this).text('Show');
}, function() {
debugger;
$(this).closest('table').next('table').show();
$(this).text('Hide');
});
});