Retrieving native DOM elements from jQuery objects?

$('myTag').get(0) returns the HTML element.


jQuery uses the Sizzle Selector Engine*. You can use it on its own too.

* Confirmed by Doug Neiner, which means it's right ;)


When you find elements with jQuery, you can get them with the "get" function:

var regularElement = $('#myElementId').get(0);

Inside a ".each()" function, the "this" pointer refers to a "real" element:

$('input.special').each(function() {
  var type = this.type;
  this.value = "exploding balloon";
  // etc
})

Using jQuery doesn't make Javascript "different." It is Javascript, and the DOM is still the DOM.