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
  • 634
  • 9
  • 21

1 Answers1

0

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

el.setAttribute('class', 'myClass');
el.className = 'myClass';
Tim S.
  • 13,597
  • 7
  • 46
  • 72