---
name: "up.Preview.prototype.removeClass"
area: "API"
kind: "Instance method"
parent: "up.Preview class"
url: "https://unpoly.com/api/up.Preview.prototype.removeClass"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.Preview class](https://unpoly.com/api/up.Preview.md)</nav>

# up.Preview.prototype.removeClass([element], className)

Temporarily removes a CSS class from an element.

The removed class will be restored once the preview [ends](https://unpoly.com/learn/previews.md#ending).

---

## Parameters {#parameters}

### [element=this.fragment] {#element}

(optional)

The element or selector to change.

If omitted, the [targeted fragment](https://unpoly.com/api/up.Preview.prototype.fragment.md) will be changed.

Type: [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) | string

### className {#className}

(required)

The CSS class to remove.

Type: string

