4 ms·
Yep, latchkey, I think you might want to rethink the article. As others have pointed out, you're seeing JavaScript's behaviour, not jQuery's. And this: elem.
by pxm 15y ago
Yep, latchkey, I think you might want to rethink the article. As others have pointed out, you're seeing JavaScript's behaviour, not jQuery's. And this:
elem.data('foo', { 'a':1, 'b':2 });
elem.data('foo'); // Returns the object
Is certainly more desirable than:
elem.attr('foo', { 'a':1, 'b':2 });
elem.attr('foo'); // Returns "[object Object]"