Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript remove class with transition

//JS
const element = document.querySelector(".myClass");
element.classList.remove("myClass")

//CSS
.default {
    background-color: blue;
    transition: background-color 1s ease-in-out;
}
.myClass {
    background-color: red !important;
}
//HTML
<div class="default myClass"></div>
 
PREVIOUS NEXT
Tagged: #javascript #remove #class #transition
ADD COMMENT
Topic
Name
5+9 =