HTMLInputElement: dirName property
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since August 2023.
ThedirName property of theHTMLInputElement interface is the directionality of the element and enables the submission of that value. It reflects the value of the<input> element'sdirName attribute. This property can be retrieved or set.
Valid only forhidden,text,search,url,tel, andemail<input> types, 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, 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
inputElement.dirName = "rtl";Specifications
| Specification |
|---|
| HTML> # dom-input-dirname> |