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 :: javascript change color of text input 
Javascript :: split string based on length in javascript 
Javascript :: $(document).ready(function() alert 
Javascript :: data not write in file node js 
Javascript :: read file in nodejs using fs 
Javascript :: bootstrap datepicker set min and max date 
Javascript :: remove duplicated from array of ojects 
Javascript :: All Longest Strings javaScript 
Javascript :: toggle boolean js 
Javascript :: add query parameter to url react router v6 
Javascript :: javascript set property for each object in array of objects 
Javascript :: is a letter javascript 
Javascript :: how to add seconds to time in js 
Javascript :: embed video by javascript 
Javascript :: javascript get current date format dd mm yyyy hh mm ss 
Javascript :: javascript split string into array by comma 
Javascript :: jqueyr element is hide 
Javascript :: res.locals in express 
Javascript :: javascript is radio button checked 
Javascript :: how to get the data from url in javascript 
Javascript :: javascript collection to array 
Javascript :: Simple code example of adding two numbers in javascript 
Javascript :: javascript array size 
Javascript :: switch case in javascript 
Javascript :: settimeout function javascript for loop 
Javascript :: button not exist js 
Javascript :: how to change background color though props 
Javascript :: js array backwards 
Javascript :: js array comprehension 
Javascript :: how to flip a Number in javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =