Ticket #9249 (closed enhancement: wontfix)
data method called on a jQuery collection only returns the data value of the first item
|Reported by:||matt@…||Owned by:|
In short, if you run the data storage method on a jquery collection of elements (eg $('p').data('foo','bar') ) it will apply that data to each of them.
However, if you run the data retrieval method on a jquery collection of elements (eh $('p').data('foo') ) it will only return the value of the first.
see example here - http://jsfiddle.net/3eERV/
... on the one hand, I can see the logic in this, but on the other, it breaks the convention of jQuery methods applying to each element in the collection.
Instead of the current behavior, I would expect it to return something like an array of values, compiled out of the value of each element in the collection.
- m a t t
- Priority changed from undecided to low
- Resolution set to wontfix
- Status changed from new to closed
- Component changed from unfiled to data
- Type changed from bug to enhancement