Computer >> Computer tutorials >  >> Programming >> Javascript

What is Microdata Vocabulary in HTML5?


To define microdata vocabulary you need a namespace URL that points to a working web page. For example, https://data-vocabulary.org/Person can be used as the namespace for a personal microdata vocabulary with the following named properties −

  • name − Person name as a simple string
  • Photo − A URL to a picture of the person.
  • URL − A website belonging to the person.

Using about properties a person microdata could be as follows:

<html>
   <body>
      <div itemscope>
         <section itemscope itemtype = "https://data-vocabulary.org/Person">
            <h1 itemprop = "name">Gopal K Varma</h1>
            <p>
               <img itemprop = "photo" src = "https://www.tutorialspoint.com/green/images/logo.png">
            </p>
            <a itemprop = "url" href = "#">Site</a>
         </section>
      </div>
   </body>
</html>