HTML Data Tag: The HTML < data > tag is used to transmit its content to a machine-readable version. The data are presented in a particular format. It is useful because a script can process it, but this might not be the format we would like the users to use.

Let’s consider a scenario:

Suppose we have to represent some numbers with letters (i.e., one, two, three, and so on) to our users, but we have a script that sorts the numbers in ascending or descending commands. So our script needs amounts in a format like 1, 2, and 3, and so on.

To solve the problem, < data > tag is used.

For users: write within tag < data>…. </data >.

For the script: use the attribute value.

HTML data tag attribute

There is only one required attribute. The Data tag also supports global attributes and event attributes.

AttributeDescription
ValueIt is a required attribute. It is used to provide content for the computer-readable version of the name.

HTML data tag example

Output

HTML Data Tag

Supporting Browsers

ElementChromeIEFirefoxOperaSafari
<data>YesYesYesYesYes

HTML Datalist Tag

The HTML < datalist > tag is used to provide a complete auto function on the form element. It provides users with a list of predefined options for selecting data.

HTML5 includes the datalist tag.

The tag < datalist > should be used with the element < input >, which contains the attribute “list.” The value of the “list” attribute is related to the Datalist Id.

Example

Let’s look at the simple example of the data list tag HTML5. If you press A, a list of cricketers will appear, starting with A letter.

Output

HTML Data Tag
HTML Data Tag

Supporting Browser

ElementChromeIEFirefoxOperaSafari
<datalist>YesYesYesYesYes

HTML Dialog tag

Log > tag is used to create a new web-page popup dialog. This tag is a dialog box or some interactive feature like a window. The < dialog > element uses the open boolean attribute that activates the component and makes it easier for the user to interact.

A new tag implemented in HTML5 is the HTML dialog.

HTML dialog tag example

Output

HTML Data Tag

The HTML Dialog tag also supports HTML attributes for global and events.

Supporting Browsers

ElementChromeIEFirefoxOperaSafari
<dialog>YesYesYesYesYes

Pin It on Pinterest

Share This