ClassListts

This commit is contained in:
2024-10-13 19:38:13 +02:00
parent 12f3276172
commit 818028a6b9
2 changed files with 30 additions and 3 deletions

View File

@ -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
});