Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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)