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

#102063
SgtLegend
Member

It could probably get as simple as

$(function() {
// Hide some stuff!
$('#searchTable, #addlink').hide();

// Loop through the "#addlink" and #searchlink" elements
$.each(, function() {
// Bind a click handler to the current element
$(document.body).delegate('click', this, function() {
// Toggle the following elements
$('#searchTable, #addTable, #searchlink, #addlink').toggle(0);
});
});
});