This property is not yet available to all users.
CustomClassList is a mixin that provides functionality for manipulating an element's custom CSS classes. For example, you can add a custom class to an element or replace an existing class with a new custom class.
Custom classes are those that you define for your site, not the predefined global classes that are provided for each element.
You define custom CSS classes in the
global.css file which can be accessed in the Page Code section of the Editor. For more information on defining custom classes,
see Add CSS to your site
and About CSS editing.
Note: This mixin is currently only available in Editor X.
Mixins provide functionality that other elements can inherit and use.
Mixins are not elements. You cannot add mixins to a page in the Editor like other
$w elements, and mixins are not meant to be used directly
in your code.
For example, you would not write code like this, because it is out of context:
js | Copy Codelet myClasses = $w("#CustomClassList").customClassList.values();
Instead, you can code the following if myElement is an element that "mixes in" CustomClassList mixin.
js | Copy Codelet myClasses = $w("#myElement").customClassList.values();
Note: This mixin only affects custom classes. If you use it for global classes, there is no effect on the element.
Was this helpful?