Firefox Tomorrow

web api instance method

HTMLTextAreaElement: select() method

View on MDN ↗

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

select()

Parameters

None.

Return value

None (undefined).

Examples

const textarea = document.getElementById("text-box");
textarea.select();

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also