jQuery object equality

Since jQuery 1.6, you can use .is. Below is the answer from over a year ago… var a = $(‘#foo’); var b = a; if (a.is(b)) { // the same object! } If you want to see if two variables are actually the same object, eg: var a = $(‘#foo’); var b = a; …then … Read more