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.
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.
You can use the .setAttribute()
method, or set the .className
property.
el.setAttribute('class', 'myClass');
el.className = 'myClass';