> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Method name: customClassList()

# Method package: w

# Method menu location: w --> Repeater --> customClassList

# Method Link: https://dev.wix.com/docs/velo/velo-only-apis/$w/repeater/custom-class-list.md

# Method Description:

A property that represents an element's custom CSS classes.

> This property is only available to Wix Studio users.

You can use this property to manipulate the custom CSS classes of an element. 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 create on a site, not the predefined global classes
that are provided for each element.

Use the following methods to work with the element's custom CSS classes:
+ [`add()`](https://dev.wix.com/docs/velo/velo-only-apis/$w/custom-class-list/add.md): Adds custom CSS classes to the class list of an element.
+ [`contains()`](https://dev.wix.com/docs/velo/velo-only-apis/$w/custom-class-list/contains.md): Indicates whether the element's class list contains a specified custom CSS class.
+ [`remove()`](https://dev.wix.com/docs/velo/velo-only-apis/$w/custom-class-list/remove.md): Removes custom CSS classes from an element's class list.
+ [`replace()`](https://dev.wix.com/docs/velo/velo-only-apis/$w/custom-class-list/replace.md): Replaces a custom CSS class of an element with a different custom CSS class.
+ [`toggle()`](https://dev.wix.com/docs/velo/velo-only-apis/$w/custom-class-list/toggle.md): Toggles an element's custom CSS class.
+ [`values()`](https://dev.wix.com/docs/velo/velo-only-apis/$w/custom-class-list/values.md): Retrieves an array of strings listing an element's custom CSS classes.

> **Note:** For more information, see [Styling Elements with CSS](https://dev.wix.com/docs/velo/velo-only-apis/$w/styling-elements-with-css.md)
> and the [MDN CSS reference docs](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Styling_basics).



# Method Code Examples:

*** Note: do not assume any prop names or enum values other than the ones in the example.

## Add a single class to an element

```javascript
$w("#myElement").customClassList.add("className1");
```

## Add multiple classes to an element

```javascript
$w("#myElement").customClassList.add("className1", "className2");
```

## Indicate whether an element contains a specified class

```javascript
$w("#myElement").customClassList.contains("className1"); //true
```

## Remove a single class from an element

```javascript
$w("#myElement").customClassList.remove("className1");
```

## Remove multiple classes from an element

```javascript
$w("#myElement").customClassList.remove("className1", "className2");
```

## Replace a class of an element

```javascript
$w("#myElement").customClassList.replace("className1, className2");
```

## Toggle a class of an element

```javascript
$w("#myElement").customClassList.toggle("className1")  // true
```

## Toggle a class of an element

```javascript
if( $w("#myElement").customClassList.contains("className1") ) {
  $w("#myElement").customClassList.replace("className1, className2");
}
else {
  $w("#myElement").customClassList.replace("className2, className1");
}
```

## Get the classes of an element

```javascript
$w("#myElement").customClassList.value; // "className1 className2"
```

## Gets a list of the classes of an element

```javascript
$w("#myElement").customClassList.values(); // ["className1", "className2"]
```

---