Skip to content

Commit

Permalink
explained detail about attribute vs aria/data
Browse files Browse the repository at this point in the history
  • Loading branch information
WebReflection committed Mar 27, 2020
1 parent 62c6107 commit 639c595
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ node.outerHTML;
<details>
<summary><strong>attribute(node, name)</strong></summary>

Handle a generic attribute `name`, updating it when its value changes.
Handle a generic attribute `name`, updating it only when its value changes.

```js
const node = document.createElement('div');
Expand All @@ -46,6 +46,8 @@ node.outerHTML;
// <div></div>
```

Please note that both `aria-attribute=${value}` and `data-attribute=${value}` are also perfectly valid, and better performing if the passed values never, or rarely, change.

</details>

<details>
Expand Down

0 comments on commit 639c595

Please sign in to comment.