Jquery Toggle Class Onclick Code Example


Example 1: toggle class javascript and jquery


$('.click-class').click(function() {
$('.class-toggle').toggle();
$('.class-toggle').toggleClass('add-class');
})

Example 2: jquery toggle class


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

Example 3: how to add toggle class in javascript using css modules


onClick() {
alert("clicked");
$('.'+ styles.transform ).toggleClass(styles.transform-active);
}

Example 4: toggle class jquery


toggleClass

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable