Back to Content

HTMLTextAreaElement: dirName property

files/en-us/web/api/htmltextareaelement/dirname/index.md

latest1.2 KB
Original Source

{{APIRef("HTML DOM")}}

The dirName property of the {{domxref("HTMLTextAreaElement")}} interface is the directionality of the element. It reflects the value of the {{htmlelement("textarea")}} element's dirName attribute. This property can be retrieved or set.

The dirname attribute controls how the element's directionality is submitted. When included, the form control will submit with two name/value pairs: the first being the name and value of the <textarea>, and the second being the value of the dirname attribute as the name, with a value of ltr or rtl as set by the browser.

Value

A string. The direction of the element.

Examples

js
textareaElement.dirName = "rtl";

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also