HTMLTextAreaElement: dirName property
Baseline 2023Newly available
Since August 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
ThedirName property of theHTMLTextAreaElement interface is the directionality of the element. It reflects the value of the<textarea> element'sdirName attribute. This property can be retrieved or set.
Thedirname attribute controls how the element's directionality is submitted. When included, the form control will submit with two name/value pairs: the first being thename andvalue of the<textarea>, and the second being the value of thedirname attribute as the name, with a value ofltr orrtl as set by the browser.
In this article
Value
A string. The direction of the element.
Examples
js
textareaElement.dirName = "rtl";Specifications
| Specification |
|---|
| HTML> # dom-textarea-dirname> |