0
How can I check element class name in JavaScript and how to change it?not classList
I've tried elementname.classList== "new_name"; to change it and it didn't change it and I want to be able to check the class name beyond just it's existence literally it's name, console.log(element.classList ) doesn't show it..
4 Respuestas
+ 6
element.classList.contains("myStyle");
+ 5
For this reason will be here each time repeated, please link your code with the question.
+ 1
elementname.classList.add("new_name")
0
Thanks but it didn't work