jQuery Remove Specific Class Examples / Demos

In jQuery, Tips and Tricks by March 17th, 2013

457 Views

If you wish to use jQuery to remove specific class of an element on a web page, we can use the .removeClass() method. In this article, I am going to share easy way to delete the specific class(es) from different elements of a web page, such as Textbox, Textarea, Select Dropdown, Image, etc.

How to use jQuery to Remove Specific Class

Let’s assume that we have different html elements on a web page such as div, image, textbox, textarea, etc. We will see how to delete the specific class(es) when a button is clicked. So here we go:

Here is the basic common HTML source code for all the following examples:

Example 1: Removing a specific class from Textbox in jQuery using Textbox ID

Example 2: Removing a specific class from Textarea in jQuery using Textarea ID

Example 3: Removing a specific class from Select Dropdown in jQuery using Select Dropdown ID

Example 4: Erasing a specific class from Image in jQuery using Image ID

Example 5: Deleting a specific class from Div in jQuery using Div ID

That’s it!

Do you know of any other ways to use jQuery to remove specific class? Feel free to suggest by commenting below.