CRecordWebRemoveClassesFromElement
The message
The message is part of the
The API is located in the plugin NY_
{ "id": "8fffd143-dab3-4f96-ac64-6f660bf45cfd", "name": "WEB_REMOVE_CLASSES_FROM_ELEMENT ", "description": "Remove classes from an HTML element.", "slots": [ { "key": "1", "name": "SELECTOR ", "direction": "REQUEST", "mandatory": "true", "type": "STRING", "description": "The selector." }, { "key": "2", "name": "CLASS ", "direction": "REQUEST", "mandatory": "true", "type": "STRING", "description": "The class to remove." }, { "key": "3", "name": "CLASSES ", "direction": "REQUEST", "mandatory": "true", "type": "STRING_ARRAY", "description": "The classes to remove." } ] }
Arguments
-
SELECTOR : The selector is used to find the HTML elements to be changed.
Example: ".example". Find more examples here -
CLASS : Use this parameter if you are only removing one class. -
CLASSES : Use this parameter if you are removing more than one class.
Usage with the helper class CWebApi
The easiest way is to call the corresponding method in the CWebApi class. The use of the class is described there.
mWebApi.removeClassFromElement(@NotNull final StringaSelector , @NotNull final StringaClass ); mWebApi.removeClassesFromElement(@NotNull final StringaSelector , @NotNull final Collection<String>aClasses );
Usage as message
The
public void removeClassesFromElement(@NotNull final CTargetAddressa , @NotNull final StringRemote Skin AddressaSelector , @NotNull final String[]aClasses ) throws CException {// Envelope final CEnvelope env = CEnvelope.forSingleTarget(m );Remote Skin Address// Record final CRecord record =CRecordWebRemoveClassesFromElement .create();CRecordWebRemoveClassesFromElement .setSelector(record,aSelector );CRecordWebRemoveClassesFromElement .setClasses(record,aClasses );// send message sendNotification(env, record); }