Reputation:
I have two variables defined as:
var div1 = $("#div1");
var div2 = $("#div2");
I know that I can use $("#div1, #div2").hide()
to hide both div
But is there a way I can hide them through defined variables like (div1, div2).hide()
?
Upvotes: 8
Views: 280