is it possible to assign CSS styles through jQ to several selectors in one statement like it can be done through pure CSS?
var foo = $('#thisEl');
var boo = $('#thatEl');
[foo and boo].css({
...CSS here
});
is it possible to assign CSS styles through jQ to several selectors in one statement like it can be done through pure CSS?
var foo = $('#thisEl');
var boo = $('#thatEl');
[foo and boo].css({
...CSS here
});
You you can use multiple selectors
$('#thisEl, #thatEl').css({
...CSS here
});
or if you have references to jQuery wrapper object only then use .add() to create a new combined jQuery wrapper
var foo = $('#thisEl');
var boo = $('#thatEl');
foo.add(boo).css({
...CSS here
});
foo.add(boo).add(goo).css({... work if you want 3 or more elements?