Skip to content
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

Add class as an alias for className #1310

Open
Psychpsyo opened this issue Sep 17, 2024 · 0 comments · May be fixed by #1311
Open

Add class as an alias for className #1310

Psychpsyo opened this issue Sep 17, 2024 · 0 comments · May be fixed by #1311

Comments

@Psychpsyo
Copy link

Psychpsyo commented Sep 17, 2024

What is the issue with the DOM Standard?

Currently, to access the class attribute of an element in Javascript, you need to use element.className instead of just element.class.
This is unintuitive and inconsistent with other attributes, and there is little reason for it because class is no longer a reserved word.

Note:
This is just to mirror issue #9379 in the HTML repo.
See it for more details and discussion.

Psychpsyo added a commit to Psychpsyo/dom that referenced this issue Sep 17, 2024
This adds class as an alias for className to be
more consistent and intuitive. This is now possible
since 'class' is no longer a globally reserved word
in Javascript.

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

Successfully merging a pull request may close this issue.

1 participant