Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery remove and add class

$( "#foo" ).toggleClass( 'className', addOrRemoveOptional );

//OR
if ($( "#foo" ).hasClass('className')) {
	$( "#foo" ).removeClass( 'className');
} else {
  $( "#foo" ).addClass( 'className');
}
Comment

jquery remove class

$("#div1").on("click", function () {
    if ($(this).hasClass("active")) {
      setTimeout(function () {
        $("#div1").removeClass("active");
      }, 10);
    }
  });
Comment

add and remove class in jquery


$('#menu li a').on('click', function(){
    $('#menu li a.current').removeClass('current');
    $(this).addClass('current');
});

Comment

add and remove class in jquery

$('#toggle li').on('click', function () {
    $(this).toggleClass('open')
});
Comment

jquery remove class

$('#element').removeClass('className');
Comment

PREVIOUS NEXT
Code Example
Javascript :: react function 
Javascript :: Select HTML elements by CSS selectors 
Javascript :: swap scroll right in react native 
Javascript :: js map array to object 
Javascript :: learn nodejs 
Javascript :: how to get json response from rest api in node js 
Javascript :: settimeout with loop js 
Javascript :: how to push mutual array elements in an array nested loop javascript 
Javascript :: document get child element by id 
Javascript :: node save wav base64 
Javascript :: js array find 
Javascript :: javascript wait for function to finish 
Javascript :: pass data between pages react 
Javascript :: new line javascript string 
Javascript :: crypto in node js 
Javascript :: laravel vue global function 
Javascript :: grid in chart.js 
Javascript :: mongoose populate 
Javascript :: jquery get textarea value 
Javascript :: jQuery intellisence in VSCode 
Javascript :: login with facebook in react 
Javascript :: javascript substring 
Javascript :: javascript color green to red 
Javascript :: javascript number if .00 truncate 
Javascript :: save file javascript 
Javascript :: javascript unknown number of parameters 
Javascript :: compare date javascript 
Javascript :: ejs to javascript array 
Javascript :: nestjs Error: Cannot find module 
Javascript :: substr method 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =