var $email = $("#email"); // refers to the jQuery object representation of the dom objectvar email_field = $("#email").get(0); // refers to the dom object itself
$$('div');// -> all DIVs in the document. Same as document.getElementsByTagName('div')!
$$('#contents');// -> same as $('contents'), only it returns an array anyway (even though IDs must be unique within a document).
$$('li.faux');// -> all LI elements with class 'faux'
var $email = $("#email"); // refers to the jQuery object representation of the dom objectvar email_field = $("#email").get(0); // refers to the dom object itself
// email is a DOM element passed into this functionfunction doSomethingWithEmail( email ) {var emailJQ = $(email);// Now email is the DOM element and emailJQ is a jQuery object for it}
var $email = $("#email"), email = $email[0];// $email is the jQuery object and email is the DOM object
和:
// email is a DOM element passed into this functionfunction doSomethingWithEmail( email ) {var $email = $(email);// $email is the jQuery object and email is the DOM object// Same names as in the code above. Yay!}