How To The Eq( ) And Get( ) Functions In JQuery?
Description:-
- The
eq( )
method returns a jQuery object, while theget( )
the method returns a JS object. - The
eq( )
method can be used directly with other jQuery methods, but theget( )
method cannot For direct use, you need to convert the return value into a jQuery object before using the jQuery method.
Example:-
$( "selectors" ).eq( 0 );
This returns as a jQuery object, meaning the DOM element is wrapped in the jQuery wrapper, which means that it accepts jQuery functions.
$( "selectors" ).get( 0 );
This returns an array of raw DOM elements. You may manipulate them by accessing their attributes and invoking their functions as you would on a raw DOM element. But it loses its identity as a jQuery-wrapped object.