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.

commit 452b528 · authored · 1 min read

Remove specific class from all elements - jQuery

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.

local graph · open full graph

"Remove specific class from all elements - jQuery" is connected to the topics JavaScript, jQuery and related to 6 other entries. Get/Set hidden field value using jQuery Get/Set hidden field value … Set selected option by value via jQuery Set selected option by valu… Vue.js List Rendering : Limit items in v-for Vue.js List Rendering : Lim… JavaScript - Determine if user is on mobile device JavaScript - Determine if u… Decode JWT Token Decode JWT Token Domain Name From URL Domain Name From URL JavaScript #javascript jQuery #jquery Remove specific class from all el…

comments

loading discussion…