Q:

how to change class by is in js by toggle

document.getElementById('myButton').onclick = function() {
    this.classList.toggle('active');
}
1

function myFunction() {
  var element = document.getElementById("myDIV");

    element.classList.toggle("mystyle");
} 
3
<button class="" id="changeicon">
	<i id="slideshow" class="fas fa-hamburger"></i>
</button>

$("#changeicon").click(function() {
			$("#slideshow").toggleClass("fa-times");
		});
0

New to Communities?

Join the community