Monthly Archives: October 2018

How To Remove Classes By Prefix In Vanilla JavaScript

Removing a class from an HTML-Element with JavaScript is easy enough. You could use jQuery for it by calling or, just as simple, go vanilla with: But what if you wanted to remove all classes starting with a prefix? Assume we have a DOM-Node like this: We want to remove all

By |2021-01-23T23:41:59+01:00October 4th, 2018|0 Comments
Go to Top