Why does $("#somediv") === $("#somediv") return false?
It seems that the same selector does not return the same Object so for example the following does not work:
- var ua = $('#somediv');
- ua.minified = true;
- ua.click(function() {
- if ($(this) === ua) { alert("foo"); }
- if ($(this).minified === true) { alert("bar"); }
The "if" statements return false. I would like to attach some custom properties/attributes to the object returned by a jQuery selector but it's not useful if the above does not work.
For sure the above is a bad usage of jQuery selectors. If there any approach for what I want to achieve?
Thanks a lot.