Объект jQuery обычно содержит коллекцию / массив узлов DOM. Например, если вы перебираете объект jQuery, такой как -
$('div').each(function() {
//In this context, this refers to the DOM node
//and $(this) refers to a jQuery object for that particular DOM node
//therefore $(this)[0] == this
this.innerHTML = 'foo';
$(this).html('foo');
$(this)[0].innerHTML = 'foo';
});
Вы также можете использовать .get () для аналогичного эффекта.
//retrieves an array of native DOM nodes using jQuery
var allDivNodes = $('div').get();
//retrieves the first node retrieved by the selector
var firstDiv = $('div').get(0);
//this is the same as get(0), however, using an array accessor can throw an exception
var firstDiv = $('div')[0];