HTML - tags - data tag

revision:


Content

"data" tag : add machine-readable translation of content syntax some examples


"data" tag : add machine-readable translation of content

top

The <data> tag is used to add a machine-readable translation of a given content. This element provides both a machine-readable value for data processors, and a human-readable value for rendering in a browser. If the content is time- or date-related, use the <time> element instead.

Attributes: the <data> element supports the global attributes. Specific attributes are:

value; value: machine-readable format -;

specifies the machine-readable translation of the content of the element.


syntax

top

<data> . . . </data>


some examples

top

The following example displays product names but also associates each name with a product number:

Codes:

                    <p class="spec">The following example displays product names 
                    but also associates each name with a product number:</p>
                    <ul style="margin-left:4vw;"> 
                    <li><data value="21053">Cherry Tomato</data></li>
                    <li><data value="21054">Beef Tomato</data></li>
                    <li><data value="21055">Snack Tomato</data></li>
                    </ul>
                

New products

Codes:

                    <div class="spec">
                        <ul>
                            <li><data value="398">Mini Ketchup</data></li>
                            <li><data value="399">Jumbo Ketchup</data></li>
                            <li><data value="400">Mega Jumbo Ketchup</data></li>
                        </ul>
                    </div>