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 :: Process.ChildProcess._handle.onexit 
Javascript :: check if object is empty js 
Javascript :: repl-input:1 in global code //// fix for phantomjs 
Javascript :: function return string javascript 
Javascript :: JavaScript Program to illustrate split() function 
Javascript :: js array find first match 
Javascript :: convert number to words javascript lakh 
Javascript :: Collision between two div vanillaJS no detection 
Javascript :: createelement and set prop attr jquery 
Javascript :: silk carousel jquery 
Javascript :: angularjs component stackoverflow 
Javascript :: bootstrapmaterialdatepicker get selected value on changes 
Javascript :: manifest.json background service worker vs scripts 
Javascript :: flatpicker not focusing in modal React 
Javascript :: javascript pdf 
Javascript :: nextjs error can not find next/bable 
Javascript :: javascript unique id generator 
Javascript :: cache management in angular 7 
Javascript :: javascript onclick parameters 
Javascript :: jquery get selected checkbox items and pass to parameter for C# MVC consumption 
Javascript :: react router 6 redirect 
Javascript :: get day in google app script 
Javascript :: index javascript array 
Javascript :: modify a string in javascript 
Javascript :: chrome extension get current tab 
Javascript :: speed of sound 
Javascript :: cant find variable idbindex react native 
Javascript :: resource route or crud routs 
Javascript :: Bracket Spacing .prettierrc 
Javascript :: jquery dropdown options in laravel 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =