I have a few divs that I\'d like to put into an array.
When I try to use jQuery.inArray(), my div (as a jQuery object) isn\'t found. Why not?
var my
$ creates a new jQuery collection object each time, so var a = $("div"), b = $("div") will actually be two different objects that don't equal each other.
Instead you can just use the selectors or some other identifying feature of the element.
var myArray = ["#div1", "#div2", "#div3"];
However it really depends on your use case.