javascript , jquery ,

Remove specific class from all elements - jQuery

Abhith Rajan Abhith Rajan FollowOctober 23, 2017 · 1 min read · Last Updated:
Share this

Code first, talks later

$(".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 FollowBuy me a coffee
Abhith Rajan is an aspiring software engineer with more than 6 years of experience and proven successful track record of delivering technology-based products and services.