Q:

How to set css to more selectors when one of it is $(this)?

I want to set background color using jquery for 2 selectors:
$('#selector1, #selector2').css('background-color', '#dcf0ff');

This is working, but how to do it, when one of selector is $(this)?
function() {
   $(this, '#element2').css('background-color', '#dcf0ff');
}

This is not working for none of selectors, and no errors are shown in the console.

A:

You can add an element to a selector via jQuery's .add() method:
$(this).add('#element2').css('background-color', '#dcf0ff')

