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 Rajan
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.

Abhith Rajan

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

Was this helpful?

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

Related SnippetsView All

Related ArticlesView All

Related VideosView All

Easy NPM Package Updates with Yarn Upgrade Interactive

The Async Await Episode I Promised

Related StoriesView All