Run
Online Code Editor
JavaScript setAttribute() method
Example of the setAttribute() method.
Click the following button to see the effect
Click me