Issue #656Opened December 18, 2017by michaellwatson3 reactions

Add and remove classes programmatically

Question

I want to add and remove classes to a selected element, adding classes is working well, but removing them is not

var componentModel = editor.getSelected();
componentModel.addClass('form-color');

I want to be able to do

componentModel.removeClass('form-color');

But its throwing an error.

I'd be grateful if someone could share the correct syntax

Answers (3)

artfDecember 19, 20172 reactions

I'll add removeClass in the next release

michaellwatsonDecember 19, 20170 reactions

That worked great, thanks for your help :)

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.