HTML DOM
GitHub 0★
Select the text of a textarea automatically
Assume that
ele
represents a textarea element.
ele
.
addEventListener
(
'focus'
,
function
(
e
)
{
// Select the text
e
.
target
.
select
(
)
;
}
)
;
See also
Attach or detach an event handler
Trigger an event
Select the text content of an element
Serialize form data into a query string