Skip to main content

Bug Tracker

Side navigation

#14280 closed bug (notabug)

Opened August 21, 2013 09:54AM UTC

Closed August 21, 2013 12:08PM UTC

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

Reported by: devel.php@gmail.com 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/

Attachments (0)
Change History (1)

Changed August 21, 2013 12:08PM UTC by dmethvin comment:1

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