Bug Tracker

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#7332 closed bug (duplicate)

.data() without args doesn't work with HTML data- attributes

Reported by: kcivey Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:

Description

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.

Change History (2)

comment:1 Changed 9 years ago by john

Resolution: duplicate
Status: newclosed

comment:2 Changed 9 years ago by john

Duplicate of #7222.

Note: See TracTickets for help on using tickets.