Suppose in jQuery I push DOM elements into an array,
var elemarray = [];
elemarray.push($('#elem1'));
elemarray.push($('#elem2'));
Would it be possible to then use $.inArray to determine if the array contains an element?
if ( $.inArray($('#elem2'), elemarray) > -1 ) { .. }
The only examples I saw for primitive types, strings and numbers.
JSFiddle, not working: https://jsfiddle.net/5knyrcph/2/
!== -1$()returns a distinct new jQuery object.!== -1