What is Microdata in HTML5?

Sharad Jaiswal
Sharad Jaiswal

Posted On: Feb 22, 2018

 

Microdata is a way of providing additional schematics to your document. With Microdata, you can create your own customized elements with the custom properties and embed them in your web application. Microdata is nothing but a group of name-value pairs. Each group is called an item and each name-value pair is a property.

The itemscope attribute in the Microdata is used to create an item and the itemprop attribute is used to create attributes for the items.

Example

<div itemscope>
         <p>My name is <span itemprop = "name">Bob</span>.</p>
</div>
<div itemscope>
 <p>My age is <span itemprop = "age">35</span>.</p>
</div>

The above code creates an itemscope with two properties name and age. It creates the following result.

My name is Bob.

My age is 35.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    HTML5 interview questions

    What is HTML5 ?

    HTML5 is the most recent version of the HTML(Hypertext Markup Language). It is a language for structuring and displaying content for the World Wide Web, a core technology of the Internet...

    HTML5 interview questions

    What is < !DOCTYPE>? Is it necessary to use in HTML5 ?

    The &lt; !DOCTYPE&gt; is an instruction to the web browser about what version of HTML the page is written in. AND The &l..

    HTML5 interview questions

    List out the new features of HTML5?

    Some of the most interesting new features in HTML5:The &lt;canvas&gt; element for 2D drawing The &lt;video&gt; and &lt..