English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

Complete List of HTML Tags

html input dirname attribute

The dirname attribute enables the submission of the text direction of the input fields. The value of the dirname attribute is always the name of the input field followed by “.dir”.

 HTML <input> tag

Online Example

HTML form, the text direction of the fields to be submitted in this form (the text direction of the input fields will also be submitted when the form is submitted):

<!DOCTYPE html>
<html>
<head>
<title>HTML: <input> dirname attribute - 基础教程网(oldtoolbag.com)</title>
<body>
<form action="action_page.php">
  First name: <input type="text" name="fname" dirname="fname.dir">
  <input type="submit" value="Submit">
</form>
</html>
Test and see ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

Internet Explorer and Safari do not support the dirname attribute.

Definition and usage

The dirname attribute enables the submission of the text direction of the input field.

The value of the dirname attribute is always the name of the input field followed by " .dir".

HTML 4.01 with HTML5difference

The dirname attribute is an HTML5New features added.

Syntax

 <input name="myname" dirname="myname.dir">

Attribute value

ValueDescription
name.dirThe text direction of the specified input field will be submitted.
 HTML <input> tag