To answer your question "Do you know why .item-ii is not being excluded from the selection?"
When you supply the array as the selector, jQuery uses $.grep()...
.not()
not: function( selector ) {
return this.pushStack( winnow(this, selector, false), "not", selector);
},
winnow()
function winnow( elements, qualifier, keep ) {
// Can't pass null or undefined to indexOf in Firefox 4
// Set to 0 to skip string check
qualifier = qualifier || 0;
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
var retVal = !!qualifier.call( elem, i, elem );
return retVal === keep;
});
} else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem ) {
return ( elem === qualifier ) === keep;
});
} else if ( typeof qualifier === "string" ) {
var filtered = jQuery.grep(elements, function( elem ) {
return elem.nodeType === 1;
});
if ( isSimple.test( qualifier ) ) {
return jQuery.filter(qualifier, filtered, !keep);
} else {
qualifier = jQuery.filter( qualifier, filtered );
}
}
return jQuery.grep(elements, function( elem ) {
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
});
}
...which compares the DOM node against your string - which has to fail of course :)
So you would have to add the DOM elements which should be excluded and not only their selector.
var temp = $(".item-ii").map(function() {
return this;
});
Example
So you should better use one of the other answers to get the effect you want :)
('li').not(temp[0]).css('background', 'red');