code: function( elem ) {
  
  		// No argument, return index in parent
  		if ( !elem ) {
  			return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
  		}
  
  		// index in selector
  		if ( typeof elem === "string" ) {
  			return jQuery.inArray( this[0], jQuery( elem ) );
  		}
  
  		// Locate the position of the desired element
  		return jQuery.inArray(
  			// If it receives a jQuery object, the first element is used
  			elem.jquery ? elem[0] : elem, this );
  	}
docs: Determine the position of an element within the matched set of elements