Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery remove array of classes

/*
.removeClass( [className] ):classNameOne or more space-separated classes 
	to be removed from the class attribute of each matched element.

So, join all the classes you want to remove into a space separated list.
*/

var classesN = [class1, class2, class3];
var classesAlpha = [classA, classB, classC];

$('#alphas').click(function() {
   $('div').removeClass(classesAlpha.join(' '));
});
$('#numbers').click(function() {
   $('div').removeClass(classesN.join(' '));
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: Angular active router change event 
Javascript :: jquery init dropdown 
Javascript :: createTextRange code example 
Javascript :: react with two components render 
Javascript :: draft save using jquery 
Javascript :: remove all elements contained in another array 
Javascript :: html document from string javascript 
Javascript :: metadata parser react 
Javascript :: store in memory an array (two-dimensional) 10rows x 10columns with random integers and show the number of elements between 10 and 20 javvascript 
Javascript :: _.extend Example 
Javascript :: _.isEqual Underscore Example 
Javascript :: lwc format date js 
Javascript :: How to Solve the Staircase Problem with 5 Lines of JavaScript 
Javascript :: creating a basic netsuite restlet 
Javascript :: prisma multiple queries in one query 
Javascript :: how to prevent screen tearing without vsync 
Javascript :: upload file to s3 using pre signed url javascript 
Javascript :: javascript get object list by value 
Javascript :: javascript create li element and append to ul 
Javascript :: prisma.db json 
Javascript :: devexpress image collection 
Javascript :: pass function name as string javascript 
Javascript :: pymxs naming nodes 
Javascript :: express-roteamento 
Javascript :: on page navigate event javascript 
Javascript :: Compare a Boolean with another value 
Javascript :: js draw number in range 
Javascript :: get number value from input e.target.value instead of string 
Javascript :: javascript How to show array content in output window 
Javascript :: angularjs Re-evalute expressions when page reloads via history 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =