Answers for "change class style javascript"

10

Javascript change element class

document.getElementById("myElementID").classList.add('myClassName');
document.getElementById("myElementID").classList.remove('myClassName');
Posted by: Guest on July-22-2019
12

javascript change element class

//Overwrite all classes
element.className = "class";

//Add class
element.classList.add("class");
Posted by: Guest on June-02-2020
0

none

//Overwrite all classes
element.className = "class";

//Add class
element.classList.add("class");
Posted by: Guest on June-02-2020

Code answers related to "change class style javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language