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

jquery body remove class

$("body").removeClass("modal-open");
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 :: loop an object in javascript 
Javascript :: javascript get element by rel attribute 
Javascript :: change image onclick html 
Javascript :: node how to stop NodeJS server process 
Javascript :: javascript consecutive numbers in array 
Javascript :: react function being called every minute 
Javascript :: typeof 
Javascript :: object deep copy 
Javascript :: how to reverse a string in javascript without using reverse method 
Javascript :: reactjs hello world 
Javascript :: how to convert date format using date pipe in angular 
Javascript :: set background color dynamically javascript 
Javascript :: react js marked import and use 
Javascript :: axios react 
Javascript :: foreach db mongodb 
Javascript :: how to run js before submit html 
Javascript :: binary gap 
Javascript :: event.preventdefault is not a function jquery 
Javascript :: modal show with jquery ready function 
Javascript :: js array clone 
Javascript :: javascript get 1 hour from now 
Javascript :: nested object javascript 
Javascript :: urlencoded limit nodejs express 
Javascript :: react native keyboard event listener 
Javascript :: convert mongodb timestamp to date javascript 
Javascript :: javascript is radio button checked 
Javascript :: refresh page by hand in react 
Javascript :: Easy Way to Check if 2 Arrays are Equal in JavaScript 
Javascript :: js get first element of array 
Javascript :: js get element by index 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =