Question: Take a look at this fiddle: <http://jsfiddle.net/8HHvf/>  

HTML

```
<ul id='myUL'>
    <li id="a"></li>
    <li id="b"></li>
    <li id="c"></li>
    <li id="d"></li>
    <li id="e"></li>
</ul>

```

JS

```
var arr = [];
$a=$('#a');
arr.push($a);
$a=$('#b');
arr.push($a);
$a=$('#d');
arr.push($a);
$a=$('#e');
arr.push($a);

console.log(arr);
if(jQuery.inArray($('li#b'),arr)!=-1){
    console.log('aurica!!!');
}

```

I am populating an array with jQuery objects but the inArray method does not find an object.  

This code suppose to write "aurica!!!" but it doesn't.

do you have any idea why, and more impotent how can I find a jQuery object inside an array???

Answer: 
You need to push `HTMLElement` if you want to check for equality or want to compare as jQuery objects are *always* unique.

```
$(document) != $(document);

```

You can simplify your code to:

```
var arr = $('#a,#b,#c,#d').get();
console.log(arr);
if (jQuery.inArray($('li#b').get(), arr) != -1) {
    console.log('aurica!!!');
}

```

`.get()` converts `jQuery` object to `HTMLElement` which can be compared upon.
i think the problem are the .val() attribute missing in the if condition. Try with this, I hope it can help you

```
var arr = [];
var a=$('#a').val();
arr.push(a);
a=$('#b').val();
arr.push(a);
a=$('#d').val();
arr.push(a);
a=$('#e').val();
arr.push(a);

console.log(arr);
if(jQuery.inArray($('li#b').val(),arr)!=-1){
   console.log('aurica!!!');
}
arr = jQuery.grep(arr, function(value) {
  return !$('#b').is(value);;
});
console.log(arr);

```