0

I'm developing an very simple WYSIWYG and want to edit images inside editor. Which is the best way in pure JavaScript to modify image class name.

Thank you.

h2odev
  • 624
  • 7
  • 20

1 Answers1

0

You can use the .setAttribute() method, or set the .className property.

el.setAttribute('class', 'myClass');
el.className = 'myClass';
Tim S.
  • 13,029
  • 7
  • 43
  • 71