The HTMLInputElement.select()
method selects all the text in a <textarea>
element or an <input>
element with a text field.
element.select()
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'select' in that specification. | Living Standard |
Calling element.select()
will not necessarily focus the input, so it is often used with HTMLElement.focus()
.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/select