If you'd like to modify an attribute of an Element on the fly, you can do so within your Javascript code using the Element.setAttribute method.
In this video we look at how we can use this method on a pre-existing element and also on a dynamically created element (through createElement)
For your reference:
[ Ссылка ]
If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Ещё видео!