I have a simple function in javascript that hides all css divs on page load:
function hideAllDivs() {
var a5 = jQuery('.a5'),
a2 = jQuery('.a2'),
b2 = jQuery('.b2'),
hd3 = jQuery('.hd3'),
hd6 = jQuery('.hd6');
a5.hide();
a2.hide();
b2.hide();
hd3.hide();
hd6.hide();
}
As you can see I have to go through each one by one to hide them. Is there a way to store these into an array and just iterate through them all at once? That way if I add a new var chained query, I don't have to then go further down the function and manually hide it?
Any help would be greatly appreciated.