# How to remove a CSS class from an element using JavaScript

By Atta Ur Rehman Shah (https://attacomsian.com/about). Published Aug 13, 2020, updated Sep 23, 2021. Topics: JavaScript.
Canonical URL: https://attacomsian.com/blog/javascrpt-dom-remove-a-css-class-from-an-element

> Learn how to use the classList property to remove one or more CSS classes from an HTML element in JavaScript.

The `remove()` method of the `classList` property can be used to remove a CSS class from an HTML element.

Let us say you have the following `<div>` element:

```html
<div class="pizza hot spicy potato">?</div>
```

To remove the `spicy` class from the above HTML element, you can do the following:

```javascript
const div = document.querySelector('div');

div.classList.remove('spicy');
```

The `remove()` method also allows you to remove multiple CSS classes from an HTML element as shown below:

```javascript
const div = document.querySelector('div');

div.classList.remove('pizza', 'potato');
```

The `classList` property works in modern browsers, and IE10 and above.

Take a look at [this article](https://attacomsian.com/blog/javascript-add-remove-toggle-css-classes) to learn more about adding, removing, and toggling CSS classes in JavaScript.
