ClassListts
This commit is contained in:
@ -30,4 +30,14 @@ buttons.forEach(button =>{
|
||||
});
|
||||
|
||||
//CLASSLISTS
|
||||
//https://youtu.be/lfmg-EJ8gm4?si=-VAntMYmkAuzoruJ&t=35022
|
||||
|
||||
var buttone = document.getElementById("buttonone");
|
||||
buttone.classList.add("textone"); //add class
|
||||
|
||||
buttone.classList.remove("mybutton"); //remove class
|
||||
|
||||
buttone = document.getElementById("buttontwo");
|
||||
|
||||
buttone.addEventListener("mouseover", event =>{
|
||||
buttone.classList.toggle("texttwo"); //toggle will add if the class is not there and remove if it is there
|
||||
});
|
||||
|
Reference in New Issue
Block a user