Advertisement
Home Open Editor ❯

HTML dirname Attribute

Example

<form action="action.php">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname" dirname="fname.dir"><br><br>
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname"><br><br>
  <input type="submit" value="Submit">
</form>

Try this code ❯

Meaning

The dirname attribute is valid for text and search input types only, the dirname attribute enables the submission of the directionality of the element.

The dirname attribute specifies the submission of the text direction of the text area and the value is always the name of the text area (suffix ".dir").


Standard Syntax

HTML: <element dirname="inputname.dir">


Applies to:

The dirname attribute can be used on the following element:

Element Attribute
<input> dirname
<textarea> dirname

Advertisement

Attribute Values

Value Description
inputname.dir The text direction of the input field will be submitted.
Home Open Editor ❯
Advertisement