How come this..
$("div.toggle1").hide();
$("div.toggle3").hide();
$("div.toggle4").hide();
$("div.toggle5").hide();
is not equvalent to this...
$('#container div').not('.toggle2').hide();
that occurs on a click event, but it doesn't work the same as manually typing out multiple hide() tags. I'm just trying to reduce the hide() tag usage for every div I keep adding on within my parent #container div.
$("div.toggle1, div.toggle3, div.toggle4, div.toggle5").hide();
Or just give every DOM element that you will hide the same class and you can just do:
$('.hideClass').hide();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With