-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
56 lines (40 loc) · 1.19 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
title: "StylePropertyMap: append() method"
short-title: append()
slug: Web/API/StylePropertyMap/append
page-type: web-api-instance-method
browser-compat: api.StylePropertyMap.append
---
{{APIRef("CSS Typed Object Model API")}}
The **`append()`** method of the
{{domxref("StylePropertyMap")}} interface adds the passed CSS value to the
`StylePropertyMap` with the given property.
## Syntax
```js-nolint
append(property, value)
```
### Parameters
- `property`
- : An identifier indicating the stylistic feature (e.g. font, width, background
color) to add.
- `value`
- : The value the given property should have.
### Return value
None ({{jsxref("undefined")}}).
## Examples
This example shows an extra background image value being added to the
{{cssxref('background-image')}} property of the element, using
{{domxref('HTMLElement.attributeStyleMap')}}.
```js
// get the button element
const buttonEl = document.querySelector("button");
// append another value to the background-image property set on the attribute
buttonEl.attributeStyleMap.append(
"background-image",
"linear-gradient(180deg, blue, black)",
);
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}