2021-10-17 18:26:00 +02:00
|
|
|
---
|
|
|
|
title: get()
|
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
```js
|
|
|
|
string attributes.get(string key)
|
|
|
|
```
|
|
|
|
|
|
|
|
Will return the value of attribute stored under `key`, or `false` if it's not set.
|
|
|
|
|
|
|
|
If key has multiple values, they will be joined together in a string, seperated by spaces.
|
|
|
|
|
|
|
|
```js
|
|
|
|
let { Path, paths } = part.shorthand();
|
|
|
|
|
|
|
|
paths.demo = new Path()
|
|
|
|
.attr('class', 'classA')
|
|
|
|
.attr('class', 'classB');
|
|
|
|
|
|
|
|
let class = paths.demo.attributes.get('class');
|
|
|
|
// class now holds: "classA classB"
|
|
|
|
```
|