Skip to content

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

Closed
@mikesherov

Description

@mikesherov

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().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions