Skip to content

Commit

Permalink
Updates dom example by using querySelectorAll
Browse files Browse the repository at this point in the history
  • Loading branch information
phenax authored Oct 28, 2018
1 parent f55ef1f commit a939f3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ getFirstNames([ '', null, 'Akshay Nair', 'John Doe', 'Bruce Fucking Lee' ]); //

* Working with dom methods
```js
const { map, forEach } = fromClassPrototype(Array);
const { forEach, join } = fromClassPrototype(Array);
const { setAttribute } = fromClassPrototype(HTMLInputElement);
const inputs = ['.js-input-name', '.js-input-email'];

inputs
|> map(selector => document.querySelector(selector))
|> join(', ')
|> (selector => document.querySelectorAll(selector))
|> forEach(setAttribute('disabled', 'disabled'));
```

0 comments on commit a939f3f

Please sign in to comment.