2021-10-17 18:26:00 +02:00
|
|
|
---
|
2022-09-29 19:01:10 +02:00
|
|
|
title: Attributes.remove()
|
2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-29 19:01:10 +02:00
|
|
|
The `Attributes.remove()` method removes the attribute values under key and
|
|
|
|
returns the Attributes object.
|
|
|
|
|
|
|
|
## Signature
|
|
|
|
|
2021-08-25 16:09:31 +02:00
|
|
|
```js
|
|
|
|
Attributes attributes.remove(string key)
|
|
|
|
```
|
|
|
|
|
2022-09-29 19:01:10 +02:00
|
|
|
## Example
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
```js
|
2022-09-29 19:01:10 +02:00
|
|
|
const attr = new Attributes()
|
|
|
|
.add('class', 'classA')
|
|
|
|
.add('class', 'classB')
|
|
|
|
.remove('class')
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-09-29 19:01:10 +02:00
|
|
|
// attr holds no data
|
2021-08-25 16:09:31 +02:00
|
|
|
```
|