dirnameBaseline · Widely available
The dirname attribute of <textarea> and <input> HTML elements includes the field's writing direction as form data on submission.
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Aug 1, 2023. Widely available since Feb 1, 2026.
Browser support
DesktopChrome
1–16Not supported
17+Supportedsince Feb 8, 2012
Current: 155Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154Firefox
1–115Not supported
116+Supportedsince Aug 1, 2023
Current: 157Safari
1–5.1Not supported
6+Supportedsince Jul 25, 2012
Current: 27MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155Firefox Android
4–115Not supported
116+Supportedsince Aug 1, 2023
Current: 157Safari iOS
1–5Not supported
6+Supportedsince Sep 10, 2012
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: dirName.
Feature detection
JS · check before using
if ("HTMLInputElement" in globalThis && "dirName" in HTMLInputElement.prototype) {
// HTMLInputElement.dirName is available
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (4). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| HTMLInputElement.dirName | 17 | 79 | 116 | 6 | 18 | 116 | 6 |
| HTMLTextAreaElement.dirName | 17 | 79 | 116 | 6 | 18 | 116 | 6 |
| input.dirname | 17 | 79 | 116 | 6 | 18 | 116 | 6 |
| textarea.dirname | 17 | 79 | 116 | 6 | 18 | 116 | 6 |