Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#9688 closed bug (duplicate)

`data` and `attr` inconsistencies with numbers

Reported by: bentruyman Owned by:
Priority: high Milestone: 1.next
Component: data Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:

Description

It looks like the data method, when reading data attributes off of nodes, is doing some sort of type conversion on numbers.

See here: http://jsfiddle.net/MZ49R/

In this example, the attribute data-foo is set to "0001". When accessed via the data method, the number 1 is returned. When accessed via the attr method the string "0001" is returned.

My expectation is that data should return the same value as attr would.

Change History (2)

comment:1 Changed 6 years ago by Rick Waldron

Component: unfileddata
Priority: undecidedhigh
Resolution: duplicate
Status: newclosed

comment:2 Changed 6 years ago by Rick Waldron

Duplicate of #7579.

Note: See TracTickets for help on using tickets.