I'm looking at the following example of explicit iteration from http://jqfundamentals.com/chapter/jquery-basics:
$( 'li' ).each(function( index, elem ) { // this: the current, raw DOM element // index: the current element's index in the selection // elem: the current, raw DOM element (same as this) $( elem ).prepend( '<b>' + index + ': </b>' ); }); The comments refer to elem as a raw DOM element, but then the code calls .prepend() on elem.
I'm just getting started with jQuery, but it's my understanding you can only call a jQuery method on a jQuery object - not on a raw DOM element. Am I misunderstanding?
.prependonelem. It calls.prependon$(elem).$( elem )is not a "raw DOM element".