Add/Remove Class on Click and Load | jquery.loading

jQuery Loading, add a class(es) to DOM items while waiting for asynchronous action. a class-load plugin that simply adds custom CSS classes and a broken theme to elements while uploading some content.

jquery add remove class onclick, add and remove class in javascript, onclick function add and remove class, onclick add and remove class to div, add remove class jquery

How to make use of it:

1. Install & Download.

$ npm install class-loading --save

2. Import the class-loading as an ES module.

import initLoading from 'class-loading';
import $ from 'WCF';


3. Or immediately load the class-loading plugin’s script after jQuery.

<script src="/path/to/cdn/jquery.min.js"></script>
<script src="/path/to/dist/loading.min.js"></script>

4. add CSS classes to the aspect. In this instance, we will create a CSS loaded.

<div id="example">
$('#example').loading('loading loader');

5. The outcome HTML markup must be like these:

<div id="example" disabled="disabled" class="loading loader">

6. Remove CSS classes from the aspect.


7. Add CSS classes and get the callback.

const done = $('selector').loading('loading', true); 

8. Add CSS classes and remove on promise resolve or reject.

const done = $('selector').loading('loading', promise); 
setTimeout(done, 5e3);

Add/Remove CSS Class While Loading Something, jQuery Loading Plugin/Github, remove class from all elements javascript, remove class from all elements jquery

See Demo And Download

Official Website(duzun): Click Here

This superior jQuery/javascript plugin is developed by duzun. For extra Advanced Usages, please go to the official website.

Related Posts


A Simple Searchable Select Dropdown Plugin | jQuery Select Search

Simple jQuery search on the selection options plugin for your website. Next, there is a checkbox replacement plugin that refines and beautifies the original selection element with…


A Quick jQuery-Based Country Picker With Flags | Country Select JS

Country Select JS is a jQuery plugin to select a country, based on the international phone input plugin. Adds a flag dropdown to any input, which lists…


Simple and Fast Autocomplete and Typeahead Javascript Library | autoComplete.js

autoComplete.js is a simple, pure, and incrementally designed JavaScript library for speed, high versatility, and seamless integration with a wide variety of projects and systems. Features Pure…


Bootstrap Notification Message Alert Plugin with jQuery

BootstrapMsg is a jQuery plugin for displaying messages with Bootstrap alert classes to generate hierarchical in-page navigation for an extended webpage sectioned by heading components. Using Bootstrap…


jQuery Plugin for Transforming HTML Tables Into Charts Using Google Charts

Chartinator is a jQuery plugin for converting HTML tables, Google Sheets and js arrays into charts using Google Charts. Use data from HTML tables Chartinator is designed…


Customizable & Composable Charts for VueJS | vue-wcharts

WCharts is a library that makes it easy to create your own charts using Vuejs. You can easily create reusable chart components. Use a basic layout or…