Bug Tracker

Opened 9 years ago

Closed 9 years ago

#14442 closed bug (duplicate)

jQuery .data method should return always fresh values

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:



As stated in the manual, the .data() method pulls in the HTML5 data- attributes only once per element.

However, this is bad from a debugging perspective - I would like to be able to do a $(el).attr("data-foo","bar") followed by either .data() or further .attr("data-foo","...") calls so that the current value of the data attribute is visible in the DOM inspector.

A quick testcase is at http://jsfiddle.net/ZYz4A/. Alternatively, I'd suggest placing something in the manual at http://api.jquery.com/data/ which says how one can quickly see the data attribute values in the Inspectors of Chrome, IE and Firefox.

Change History (1)

comment:1 Changed 9 years ago by dmethvin

Resolution: duplicate
Status: newclosed

Duplicate of #14441.

Note: See TracTickets for help on using tickets.