jquery/learn.jquery.com — pull request #424 by artmees (2013-09-15 13:04:45+00:00)
Title: fixing issue#422 on wrong output in newer jQuery versions

the output of the `.index()` will vary in versions greater than **1.8.3**

as the code in version 1.8.3 changed from
```
// Determine the position of an element within
// the matched set of elements
index: 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 );
},
```
to
```
// Determine the position of an element within
// the matched set of elements
index: function( elem ) {

// No argument, return index in parent
if ( !elem ) {
return ( this[0] && this[0].parentNode ) ? this.first().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 );
},
```
in version **1.9.0b1** and newer versions