on-internet
← Community

How to add a class to an HTML element with JavaScript?

Stack Overflow ·

I have an element that already has a class: <div class="someclass"> ... </div> How can i add a class to the div (not replace, but add) with JavaScript?

Comments

Sign in or sign up to comment and upvote.

No comments yet.