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:
- $('.element').fadeIn();
- $('.element.active').fadeOut();
I'm assigning element to a variable.
How to add class 'active' to this variable?
Case B:
- $('.element').fadeIn();
- $('.element > .child').fadeIn();
How to use .find() method to select direct child of the element?
Case C:
- $('.element').fadeIn();
- $('.element, .other-element').fadeIn();
How to add other element separated by comas to a variable?