HTML itemid Attribute (original) (raw)
Last Updated : 30 Aug, 2024
In this article, we will learn about HTML itemid attribute with its implementation through the examples.
We know that all the HTML elements have attributes as they provide additional information about that particular element. It takes two parameters, _name and value which define the properties of the element and are placed inside the element tag.
The **itemid is a type of global attribute. Attributes that are common to all elements of HTML that provide microdata in the form of a unique, global identifier of an item. You should use this attribute only when you are using microdata. This attribute can only be used with those elements that have both itemscope and itemtype attributes. If the itemid attribute is missing then it is said to have no global identifier.
**Syntax:
- ****
- **
- Title
- The Intro to C++
- Author
- GFG Pvt. Ltd.
- Publication date
- Name
- Intro to Java
- Instructor
- Geeky G
- Start date
**Attribute Value: This attribute must have a value that is a valid URL having no leading and trailing whitespace.
**Supported tags:
**Note: The **itemid must be URL or you can also use URN as we have used in the below example.
**Example 1: In this example we creates a simple webpage with a book listing using microdata. It defines the book's title, author, and publication date within a descriptive list (
- ), enhancing SEO.
HTML `
GeeksforGeeksWelcome To GFG Books
`
**Output:
**Example 2: In this example we creates a webpage showcasing a course listing with microdata, including the course name, instructor, and start date using a descriptive list (
- ), enhancing structured data.
HTML `
GeeksforGeeksGeeks Courses
`
**Output:
**Supported Browser: