HTMLTextAreaElement: required property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{ APIRef("HTML DOM") }}

The **required** property of the {{DOMxRef("HTMLTextAreaElement")}} interface specifies that the user must fill in a value before submitting a form. It reflects the {{htmlelement("textarea")}} element's [required](/en-US/docs/Web/HTML/Reference/Elements/textarea#required) attribute.

Value

A boolean.

Examples

js
const textareaElement = document.getElementById("comment");
console.log(textArea.required);

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{HTMLElement("textarea")}}
  • {{DOMXref("HTMLTextAreaElement.validity")}}
  • {{cssxref(":required")}} pseudo-class