New course! Every coder should learn Generative AI!
Try a free lesson+ 3
Can we modify the attribute’s value of the HTML tag dynamically?
HTML HELP
2 Answers
+ 5
Yes, u can do it using JS
+ 2
let element = document.querySelector("button")
element.setAttribute("class", "aCoolButton")