jQuery passes a version of itself to global scope with this statement:
window.jQuery = window.$ = jQuery;
as shown in this SO Post.
Looking at the jQuery source we can see the definition is in top scope for jQuery and defined like this:
// Define a local copy of jQuery
jQuery = function( selector, context ) {
// The jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init( selector, context, rootjQuery );
},
The selector seems pretty straight forward to use: Just pass in a string to select an element or elements from the DOM.
However, how do you use the context parameter correctly?
From the jQuery manual:
Note that jQuery looks at the presence and type of its parameters and acts accordingly.