Travis build: 461
This commit is contained in:
@ -9,5 +9,5 @@ const getStyle = (el, ruleName) => getComputedStyle(el)[ruleName];
|
||||
```
|
||||
|
||||
```js
|
||||
getStyle(document.querySelector('p'), 'font-size') // '16px'
|
||||
getStyle(document.querySelector('p'), 'font-size'); // '16px'
|
||||
```
|
||||
|
||||
@ -5,9 +5,9 @@ Sets the value of a CSS rule for the specified element.
|
||||
Use `element.style` to set the value of the CSS rule for the specified element to `value`.
|
||||
|
||||
```js
|
||||
const setStyle = (el, ruleName, value) => el.style[ruleName] = value;
|
||||
const setStyle = (el, ruleName, value) => (el.style[ruleName] = value);
|
||||
```
|
||||
|
||||
```js
|
||||
setStyle(document.querySelector('p'), 'font-size', '20px') // The first <p> element on the page will have a font-size of 20px
|
||||
setStyle(document.querySelector('p'), 'font-size', '20px'); // The first <p> element on the page will have a font-size of 20px
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user