text-content
Version:
A cross-browser function for getting and setting the text value of a DOM element.
27 lines (19 loc) • 736 B
Markdown
# text-content
text-content is a cross-browser function for getting and setting the text value of a DOM element.
[](https://travis-ci.org/michaelrhodes/text-content)
[](https://ci.testling.com/michaelrhodes/text-content)
## Install
```
npm install text-content
```
### Example
``` js
var text = require('text-content')
var span = document.createElement('span')
text(span, 'Some text')
console.log(text(span))
// => Some text
```
It can also be used on the server with [mkdom](https://github.com/michaelrhodes/mkdom).
### License
[MIT](http://opensource.org/licenses/MIT)