Side navigation
#14443 closed bug (duplicate)
Opened October 13, 2013 02:28AM UTC
Closed October 13, 2013 12:00PM UTC
jQuery .data method should return always fresh values
Reported by: | marco@m-s-d.eu | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.10.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi!
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.
Attachments (0)
Change History (1)
Changed October 13, 2013 12:00PM UTC by comment:1
resolution: | → duplicate |
---|---|
status: | new → closed |
Duplicate of #14441.