The <data> tag gives an address to a given content with a machine-readable translator. This element provides a machine-readable value for the processors and a human-readable value that is rendered in the browser.
Note: If the content is a date or time-related content, then use <time> element instead of the data element.
Syntax:
<data value=""> Contents... </data>
Attributes:
This tag accepts a single attribute as mentioned above and described below.
Attribute Values |
Description |
---|---|
It contains a single machine-readable translation of the content. |
Example 1: In this example, we will see the implementation of the data tag with an example.
<!DOCTYPE html> < html >
< body >
< h1 >GeeksforGeeks</ h1 >
< h2 >< data > Tag</ h2 >
< p >GeeksforGeeks Subject List:</ p >
< ul >
<!-- data Tag starts here -->
< li >
< data value = "009" >Data Structure
</ data >
</ li >
< li >
< data value = "010" >Algorithm
</ data >
</ li >
< li >
< data value = "011" >HTML
</ data >
</ li >
< li >
< data value = "019" >Operating System
</ data >
</ li >
< li >
< data value = "110" >Computer Network
</ data >
</ li >
< li >
< data value = "111" >DBMS
</ data >
</ li >
<!-- data Tag ends here -->
</ ul >
</ body >
</ html >
|
Output:
Example 2: In this example, we will see the implementation of the data tag with another example.
<!DOCTYPE html> < html >
< body >
< h1 >GeeksforGeeks</ h1 >
< h2 >The < code >< data ></ code > Tag</ h2 >
< p >GeeksforGeeks Course List:</ p >
< ul >
< li >
< strong >Web Development:</ strong >
< data value = "101" >
HTML, CSS, JavaScript
</ data >
</ li >
< li >
< strong >Algorithms Masterclass:</ strong >
< data value = "202" >
Sorting, Searching,
Dynamic Programming
</ data >
</ li >
< li >
< strong >Python for Beginners:</ strong >
< data value = "303" >
Python Basics, Data Structures
</ data >
</ li >
< li >
< strong >Operating Systems Fundamentals:</ strong >
< data value = "404" >
Processes, Memory Management
</ data >
</ li >
< li >
< strong >Networking Essentials:</ strong >
< data value = "505" >
TCP/IP, DNS, Firewalls
</ data >
</ li >
< li >
< strong >Database Design:</ strong >
< data value = "606" >
Relational Databases, SQL
</ data >
</ li >
</ ul >
</ body >
</ html >
|
Output:
Supported Browsers:
- Google Chrome 62
- Edge 18
- Firefox 22
- Opera 49
- Safari 10