HTMLTextAreaElement: select() method
The select()
method of the HTMLTextAreaElement
interface selects the entire contents of the <textarea>
element. In addition, the select
event is fired. The select()
method does not take any parameters and does not return a value.
Syntax
js
select()
Parameters
None.
Return value
None (undefined
).
Examples
js
const textarea = document.getElementById("text-box");
textarea.select();
Specifications
Browser compatibility
See also
<textarea>
select
eventaddEventListener()
- CSS
::selection
pseudo-element