New Attributes in HTML 5 and Implementation Testing

HTML 5 tags include new attributes. Here is a list with browser-based tests to see if they are recognized.

Form objects, in particular, have new attributes that will facilitate the creation of online applications and user interaction.

Here are the ones that seem substantial. Compatibility checking is performed with the current browser.

editable
You can edit any HTML element. This can be a paragraph (<p>), a list (<ul>), etc.
To be useful, it must be saved for a future session. This attribute is associated with localStorage functions that store data in a space reserved for the browser.

Customer support:

necessary
This attribute without a value indicates that the field in question must have a value to validate the form. Browsers can highlight a form field when required, such as a red border.
If the form is not validated, a warning message appears indicating that the required field must be filled in.
Example:
 <input name="x" required>

Customer support:

form
This is a tag, but is now also an attribute for form objects. This allows you to place them anywhere on the page and associate them with the form by specifying an identifier.
Example:
<form id="x"></form><button form="x" />

Customer support:

novalidate
A form attribute indicating that form data should be submitted without validation. The required attribute is ignored.
draggable, dropzone
Two attributes for any tag: the first indicates that the element can be moved, the second that it can be placed here.

Customer support:

asynchronous
A Script attribute that causes JavaScript to execute asynchronously when the page is fully loaded, even if it is at the top of the page.
 <script async></script>

Customer support:

the return
For a list, <ol> displays the numbers in descending order.

Customer support:

download
For a URL, loads the file instead of displaying it.
<a href="filename" download="newfilename"></a>

Customer support:

Input and Textarea attributes

In addition to the attributes already discussed that are common to multiple form objects, certain attributes populate the form fields.

automatic filling
This form tag attribute has two values: on if autocomplete is enabled, and off otherwise. When enabled, what a user enters into a text field can be automatically populated by the browser based on what they previously entered into the same field.
The developer does not need to incorporate anything else.
Example:
 <form action="" autocomplete="on"> 

Customer support:

sample
To it
regular expression is assigned. Exempli gratia:
<input pattern="[A-Za-z0-9]">
to check the correctness of the user-defined text restricted to alphanumeric characters.

Customer support:

filler
In addition to the "value" attribute for the input text field. It displays a representative value in the text field, and when you click in the field, unlike the value, this content disappears. It is not passed with form values.

Customer support:

dirnameh
Dirname = direction name, text direction name, left-to-right or right-to-left, which is useful for countries where the direction is reversed. This direction for the text area and input fields is usually selected by default by the browser depending on the country in which it is located, or depending on the content of the page. It's ltr or rtl. For example, if we assign the dirname attribute "mydir," in the form data we will have mydir = ltr or mydir = rtl.

Customer support:

min, max, step
These attributes apply to text fields of type number, range, date, datetime, datetime-local, month, week, time. They restrict the values that can be entered with a lower bound, upper bound, and increment, respectively.
Example:
<input type="number" min="1" max="100" step="3" />

Customer support:

Document attributes

In the <head> tag, the charset attribute replaces the complex meta definition...

<meta charset="utf-8">

In fact, this was supported by browsers long before HTML 5 without standardization.

The <html> manifest attribute references an offline manifest file, indicating a list of content to cache.

Some attributes disappear...

Conversely, some HTML 4 attributes become useless and obsolete. This applies to the type attribute for <style> or <script> tags. We are now just writing:

<style></style>
<script></script>

Images no longer have a name attribute, only an identifier.

Weight and height remain useful for certain tags, such as img and canvas, but are obsolete in tables.

Note: This page only covers attributes and does not cover new or obsolete tags.

See also