================
jQuery DOM Cache is a plugin for caching DOM elements and collections preventing overuse of selector lookups on persistent DOM structures.
If you are using jQuery < 2.x, domCache is the plugin name. If you prefer to use domCache as the name, remove the conditional var "name" assigment.
Remove objects from the cache by passing an empty string selector.
Refresh the cached collection with only what exists in the current DOM.
Do NOT bind events to nodes which may be removed from the document.
NOTE: $.cache is a hidden deprecated core property of jQuery (1.x) which is being removed.
If (the jQuery Core)
$.domCache("videos",".yt,.vimeo").css({border:"1px solid blue"});
$.domCache("animImages","img.animated").hide();
$.domCache("forms","form");
$.domCache("animImages").show("slow");
$.domCache("videos").fadeOut();
var $myForms = $.domCache("forms");
$myForms.on("submit",function(){});
The refresh method lets you reset the cached object to include only the matching elements (based on the original selector) currently in the DOM.
$.domCache("videos").refresh();
$.domCache("forms",'');