Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14280 closed bug (notabug)

Data attribute set by .attr method is not correctly retrieved by .data method

Reported by: devel.php@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version:
Keywords: Cc:
Blocked by: Blocking:

Description

Setting a data attribute with .attr in between .data calls does not update the value returned by the second .data call : http://jsfiddle.net/9yPhS/

Change History (1)

comment:1 Changed 6 years ago by dmethvin

Resolution: notabug
Status: newclosed

http://api.jquery.com/data/

The data- attributes are pulled in the first time the data property is accessed and then are no longer accessed or mutated (all data values are then stored internally in jQuery).

http://www.learningjquery.com/2011/09/using-jquerys-data-apis

Note: See TracTickets for help on using tickets.