classname toggle js
document.getElementById('myButton').onclick = function() {
this.classList.toggle('active');
}
Yucky Yak
document.getElementById('myButton').onclick = function() {
this.classList.toggle('active');
}
<button class="" id="changeicon">
<i id="slideshow" class="fas fa-hamburger"></i>
</button>
$("#changeicon").click(function() {
$("#slideshow").toggleClass("fa-times");
});