Skip to content

Document how .data("name", null/undefined) works #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mikesherov opened this issue Oct 15, 2012 · 1 comment
Closed

Document how .data("name", null/undefined) works #120

mikesherov opened this issue Oct 15, 2012 · 1 comment

Comments

@mikesherov
Copy link
Member

From the OP:

Right--that's fine. What's confusing is if the documentation implies that .data("name", null) will have the same effect as .removeData("name"). It will not:

.data("name", null) will set the value to null (future calls to .data("name") will yield null)
.removeData("name") will remove the data item entirely (future calls to .data("name") will yield undefined)

From @rwldrn:

To avoid a re-query of the data- attribute, set the name to a value of null (e.g. .data("name", null)) rather than using .removeData().

@dmethvin
Copy link
Member

This looks to have been already fixed.

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

No branches or pull requests

2 participants