+ 3

Can we modify the attribute’s value of the HTML tag dynamically?

HTML HELP

21st Oct 2020, 3:33 PM
Lu©️ky ®️ajput™️
Lu©️ky ®️ajput™️ - avatar
2 Réponses
+ 5
Yes, u can do it using JS
21st Oct 2020, 3:33 PM
Steve Sajeev
Steve Sajeev - avatar
+ 2
let element = document.querySelector("button") element.setAttribute("class", "aCoolButton")
21st Oct 2020, 5:30 PM
maf
maf - avatar