toggle css class code example

Example 1: javascript remoev css class

//remove a css class from an element
document.getElementById("myElementID").classList.remove("class_name");

Example 2: toggle css class in javascript

/* var or const followed by its name */.getElementById(/* HTML element ID */);
/* var or const's name */.classList.toggle(/* Name of CSS class */);
// I hope this helps!

Example 3: jquery toggle class

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

Example 4: toggle class javascript

var menu = document.querySelector('.menu') // Using a class instead, see note below.
menu.classList.toggle('hidden-phone');

Example 5: css psedo class

button:hover {
  color: blue;
}

A pseudo-class is a word such as :hover that makes its changes
to the selected element by adding it along side the selector 
before the curly braces in CSS instead of inside the curly 
braces.

You can search for a list of pseudo-class online.

Example 6: toggle class

<div class="tumble">Some text.</div>