Ticket #7332 (closed bug: duplicate)
.data() without args doesn't work with HTML data- attributes
|Reported by:||kcivey||Owned by:|
Now that HTML5 data- attributes are in the core, those values should be included in the object returned by $('#id').data(). Currently the HTML5 data handling is only in the part of .data() that deals with a passed key. So you can use, for example, $('#id').data('test') to retrieve the value of the "data-test" attribute, but if you try $('#id').data(), with no argument, you'll get an empty object (assuming you haven't set metadata by other means) rather than an object with a "test" property in it.