HTMLTextAreaElement: wrap property

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.

Thuộc tính wrap của giao diện HTMLTextAreaElement cho biết điều khiển nên ngắt dòng giá trị như thế nào khi gửi biểu mẫu. Nó phản ánh thuộc tính wrap của phần tử <textarea>. Lưu ý rằng giá trị "hard" chỉ có tác dụng khi thuộc tính cols cũng được đặt.

Giá trị

Xem wrap để biết các giá trị có thể. Mặc định là "soft".

Ví dụ

js
const textareaElement = document.getElementById("comment");
const oldWrap = textArea.wrap;
textArea.wrap = "hard"; // Add line breaks (CR+LF) during form submission

Đặc tả kỹ thuật

Thông số kỹ thuật
HTML
# dom-textarea-wrap

Tương thích trình duyệt

Xem thêm