I use a selector to get a group of objects (0 or more):
var $openMenus = $Triggers.filter(".trigger-hover");
Then I have an event attached to an element, which may or may not be in the above object. In this case, when I want to compare the element that fires the event, c
$([selector]) .focus(function(){ var $thisMenu = $(this); $openMenus.each(function(){ if ($(this) != $thisMenu ){ [do something] } }) })
This will not work. Although multiple jQuery objects can REALLE the same DOM object, they are actually separate jQuery objects, and true will never be compared for this.
Given what will handle this? How do you have two jQuery objects and compare them to see if one jQuery object references the same DOM element as the other?
I can give each element that I am trying to select an ID, but I am wondering if there is another way to do this without adding more to the HTML.
jquery object comparison
DA
source share