Hot to properly use cache in jQuery

Hot to properly use cache in jQuery

Hello.

I'm trying to understand how to properly use caching in jQuery.
I have a few cases.

Case A:
  1. $('.element').fadeIn();
  2. $('.element.active').fadeOut();


I'm assigning element to a variable.
How to add class 'active' to this variable?


Case B:
  1. $('.element').fadeIn();
  2. $('.element > .child').fadeIn();

How to use .find() method to select direct child of the element?


Case C:
  1. $('.element').fadeIn();
  2. $('.element, .other-element').fadeIn();

How to add other element separated by comas to a variable?