How does this data.target == this work?
jquery example
.mouseup(function(data, handler)
{
if(data.target == this)
{
// some code
}
})
Does this compare the objects by comparing each of their respective properties?
I need this check because I want the mouseup only on the parent div and on one child.
if (data.target == this || * if this has className XXX * ) {
// some code
}
if (data.target == this)evaluates to true ifthisrefers to the same object in memory asdata.target.The
==operator does not compare member values. See Object comparison in JavaScript.