| 1 |
# select |
| 2 |
|
| 3 |
[](https://travis-ci.org/zenorocha/select) |
| 4 |
|
| 5 |
Programmatically select the text of a HTML element. |
| 6 |
|
| 7 |
## Install |
| 8 |
|
| 9 |
You can get it on npm. |
| 10 |
|
| 11 |
``` |
| 12 |
npm install select --save |
| 13 |
``` |
| 14 |
|
| 15 |
Or bower, too. |
| 16 |
|
| 17 |
``` |
| 18 |
bower install select --save |
| 19 |
``` |
| 20 |
|
| 21 |
If you're not into package management, just [download a ZIP](https://github.com/zenorocha/select/archive/master.zip) file. |
| 22 |
|
| 23 |
## Usage |
| 24 |
|
| 25 |
### Standalone |
| 26 |
|
| 27 |
```html |
| 28 |
<script src="dist/select.js"></script> |
| 29 |
``` |
| 30 |
|
| 31 |
```js |
| 32 |
var input = document.querySelector('input'); |
| 33 |
var result = select(input); |
| 34 |
``` |
| 35 |
|
| 36 |
### Browserify |
| 37 |
|
| 38 |
```js |
| 39 |
var select = require('select'); |
| 40 |
``` |
| 41 |
|
| 42 |
```js |
| 43 |
var input = document.querySelector('input'); |
| 44 |
var result = select(input); |
| 45 |
``` |
| 46 |
|
| 47 |
## License |
| 48 |
|
| 49 |
[MIT License](http://zenorocha.mit-license.org/) © Zeno Rocha |