Kebab file names

This commit is contained in:
Angelos Chalaris
2023-04-27 21:58:35 +03:00
parent 1d189c709a
commit 61200d90c4
440 changed files with 0 additions and 0 deletions

21
snippets/remove-class.md Normal file
View File

@ -0,0 +1,21 @@
---
title: Remove class from HTML element
tags: browser
author: chalarangelo
cover: bag-waiting
firstSeen: 2020-12-30T19:21:15+02:00
lastUpdated: 2020-12-30T19:21:15+02:00
---
Removes a class from an HTML element.
- Use `Element.classList` and `DOMTokenList.remove()` to remove the specified class from the element.
```js
const removeClass = (el, className) => el.classList.remove(className);
```
```js
removeClass(document.querySelector('p.special'), 'special');
// The paragraph will not have the 'special' class anymore
```