DEV Community

Cover image for Add Multiple Styles Using JavaScript
Amran AL Ketara
Amran AL Ketara

Posted on • Originally published at amkblog.com

Add Multiple Styles Using JavaScript

Adding multiple styles to an element with vanilla JavaScript can feel a bit clunky. The most common approach I’ve seen to style elements with plain JavaScript is to grab your target element, and then add one style at a time.
https://amkblog.com/css/add-multiple-styles-using-javascript/

Top comments (1)

Collapse
 
sloan profile image
Sloan the DEV Moderator

Hi there, we encourage authors to share their entire posts here on DEV, rather than mostly pointing to an external link. Doing so helps ensure that readers don’t have to jump around to too many different pages, and it helps focus the conversation right here in the comments section.

If you choose to do so, you also have the option to add a canonical URL directly to your post.