Skip to content

element.classList vs element.dataset #18

Description

@felquis

I was thinking that there's no way to treat dataset values like classList DOMTokenList

In the CSS we can do element.classList.remove('class-name'), also toggle, add, contains. Using dataset, we don't have this super power, we'll have to use something just like this

I don't know if it's possible to use DOMTokenList with another string because I can't do a = new DOMTokenList(str).... :/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions