1. Home
  2. ›
  3. Javascript
  4. ›
  5. Set attribute

Set the value of the targeted data attribute.

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