+ 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 Answers
+ 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