Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Please help improve this simple jquery Re: Please help improve this simple jquery

#102066
Mottie
Member

I would do this:

$(function() {

// initially hidden
$('#searchTable, #addlink').hide();

$('#addlink, #searchlink').click(function(){
$('#searchlink, #addTable, #searchTable, #addlink').toggle();
});

});

@SgtLegend: I didn’t think delegate is really necessary in this case.