Skip to content
This repository has been archived by the owner on Feb 24, 2022. It is now read-only.

$.data doesn't work when hyphen is used #96

Closed
nickngqs opened this issue Nov 23, 2017 · 1 comment
Closed

$.data doesn't work when hyphen is used #96

nickngqs opened this issue Nov 23, 2017 · 1 comment

Comments

@nickngqs
Copy link

This will not work

div(data-animal-type='dragon')
$('div').data('animal-type'); // undefined

This will work

div(data-animaltype='dragon')
$('div').data(animaltype); // dragon

I think animal-type should work since we see alot of hyphens in HTML documents and is in the spec as well

@webpro webpro closed this as completed in 8607aa5 Dec 3, 2017
@webpro
Copy link
Owner

webpro commented Dec 4, 2017

Thanks @nickngqs, you're absolutely right. This has been fixed and released as v0.15.5.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants