1. Home
  2. Javascript
  3. Set attribute

Set the value of the targeted data attribute.

#javascript#select#attribute
element.setAttribute('attribute','value');
copy
Full Javascript cheatsheet