Answers for "jquery toggle class"

13

jquery toggle class

$( "#foo" ).toggleClass( 'className', addOrRemoveOptional );
Posted by: Guest on May-14-2020
0

toggle class javascript and jquery

$('.click-class').click(function() {
    $('.class-toggle').toggle();
    $('.class-toggle').toggleClass('add-class');
})
Posted by: Guest on November-09-2020
1

jquert toggleClass condition

// add class [class-name] if condition is true
// or else remove it
$('#foo-bar').toggleClass('class-name', condition)
Posted by: Guest on November-10-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language