javascript | jquery

Remove specific class from all elements - jQuery

This a short article about how can we remove a specific class from all elements that do have the class easily using jQuery.

Abhith RajanOctober 23, 2017 · 1 min read · Last Updated:

Code first, talks later

1$(".class-name").removeClass("class-name");

In the above code, we are finding all the elements that do have the class and removing it.

Story behind this post

Today my colleague asked me whether they can remove some specific class from whole elements who do have the class. Not just that, this has to be done only on mobile devices (post about Determine if the user is on the mobile device is coming next). This post is to make his day a little easier.

Update

The post Determine if the user is on the mobile device is live now.

Written by Abhith Rajan
Abhith Rajan is an aspiring software engineer with more than 8 years of experience and proven successful track record of delivering technology-based products and services.
Buy me a coffee

Was this article helpful?

Your opinion matters

Please share your thought about this article

This page is open source. Noticed a typo? Or something unclear?
Improve this page on GitHub

Related Videos

The Async Await Episode I Promised

Related Stories