Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/goto-bus-stop/empty-element
Empty a DOM element.
https://github.com/goto-bus-stop/empty-element
dom
Last synced: 27 days ago
JSON representation
Empty a DOM element.
- Host: GitHub
- URL: https://github.com/goto-bus-stop/empty-element
- Owner: goto-bus-stop
- License: mit
- Created: 2015-10-11T10:07:37.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T18:47:00.000Z (over 7 years ago)
- Last Synced: 2024-10-05T16:26:25.396Z (about 1 month ago)
- Topics: dom
- Language: JavaScript
- Homepage: https://npmjs.com/package/empty-element
- Size: 2.93 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# empty-element
Empty a DOM element.
## Usage
```js
var empty = require('empty-element')
var list = document.querySelector('ul')empty(list)
```The `empty` function returns the element, so you can quickly set element
contents by doing something like:```js
empty(list).appendChild(makeLiElement('content'))
```## License
[MIT](./LICENSE)