HTMLTextAreaElement: select() method
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Phương thức select() của giao diện HTMLTextAreaElement chọn toàn bộ nội dung của phần tử <textarea>. Ngoài ra, sự kiện select cũng được kích hoạt. Phương thức select() không nhận tham số nào và không trả về giá trị.
Cú pháp
js
select()
Tham số
Không có.
Giá trị trả về
Không có (undefined).
Ví dụ
js
const textarea = document.getElementById("text-box");
textarea.select();
Đặc tả kỹ thuật
| Specification |
|---|
| HTML> # dom-textarea/input-select-dev> |
Tương thích trình duyệt
Xem thêm
<textarea>- Sự kiện
select addEventListener()- Pseudo-element CSS
::selection