HTML Questions & Answers – Microdata

This set of HTML Problems focuses on “Microdata”.

1. __________ is an HTML specification used to add more information to HTML tags.
a) Macrodata
b) Microdata
c) Minidata
d) Modifydata
View Answer

Answer: b
Explanation: The Microdata spec provides a standardized syntax for additional semantic markup to your web pages to enhance the machine readability of your web pages. The planning for distribution center operation is offered by minidata. Macrodata and Modifydata are not any terms related to HTML5.

2. The microdata model consists of groups of name-value pairs known as ________
a) Item
b) Property
c) Value
d) URL
View Answer

Answer: a
Explanation: The microdata model consists of groups of name-value pairs known as items. Each group is known as an item. Each item can have item types, a global identifier (if the vocabulary specified by the item types support global identifiers for items), and a list of name-value pairs. A Uniform Resource Locator, called URL, termed as web address and is used for a reference to a web resource for finding its location. Property is information about a particular id or else attribute.

3. Every HTML element may have an ____________ attribute specified.
a) itemtype
b) relevant types
c) itemscope
d) itemref
View Answer

Answer: c
Explanation: “itemtype” attribute specifies URL that is used to provide item’s data in data structure. An element with the itemscope attribute specified creates a new item, a group of name-value pairs.
advertisement
advertisement

4. Which of the following is true if the property value of a name-value pair added by an element with an itemprop attribute is a meta element?
a) The value is the item created by the element
b) The value is the value of the element’s value attribute, if it has one, or the empty string otherwise
c) On getting, if the element has a datetime content attribute, the IDL attribute must return that content attribute’s value
d) The value is the element’s textContent
View Answer

Answer: b
Explanation: When the property value of a name-value pair added by an element with an itemprop attribute which is a meta element then the value is the value of the element’s value attribute, if it has one, or the empty string otherwise. The “itemprop” attribute is a global attribute which adds properties to item.

5. Which of the following is true if the property value of a name-value pair added by an element with an itemprop attribute is a time element?
a) The value is the element’s datetime value
b) The value is the value of the element’s content attribute, if any, or the empty string if there is no such attribute
c) The value is the value of the element’s value attribute, if it has one, or the empty string otherwise
d) The value is the element’s textContent
View Answer

Answer: a
Explanation: The “itemprop” attribute is a global attribute which adds properties to item. When the property value of a name-value pair added by an element with an itemprop attribute which is a time element then the value is the element’s datetime value.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. The ___________ of an item is the value of its element’s itemid attribute.
a) token
b) typed item
c) global identifier
d) scope
View Answer

Answer: c
Explanation: The global identifier of an item is the value of its element’s itemid attribute, if it has one, resolved relative to the element on which the attribute is specified. If the itemid attribute is missing or if resolving it fails, it is said to have no global identifier. The “typed item” creates new item.

7. If the element has an itemscope attribute, it returns an __________ object with all the element’s properties.
a) itemscope
b) dom object
c) collection.namedItem
d) itemtype
View Answer

Answer: b
Explanation: When an HTML document is loaded into a web browser, it becomes a document object. In web browser, document model represents document as a logical tree. The “itemscope” attribute which is of boolean type is used to state the scope of metadata.
advertisement

8. Which of the following is true if the property value of a name-value pair added by an element with an itemprop attribute is a data element?
a) The value is the value of the element’s value attribute if it has one, or the empty string otherwise
b) The value is the item created by the element
c) The value is the element’s datetime value
d) The value is item’s scope
View Answer

Answer: a
Explanation: The “itemprop” attribute is a global attribute which adds properties to item. When the property value of a name-value pair added by an element with an itemprop attribute which is a data element then the value is the value of the element’s value attribute if it has one, or the empty string otherwise.

9. Which method takes a string that contains an unordered set of unique space-separated tokens that are case-sensitive, representing types?
a) document.getItems
b) element.itemProp
c) collection.namedItem
d) object.itemref
View Answer

Answer: a
Explanation: When called, the method must return a live NodeList object containing all the elements in the document, in tree order, that are each top-level microdata items whose types include all the types specified in the method’s argument, having obtained the types by splitting the string on spaces.
advertisement

10. The goal of microdata is to create a unified way to define the data in a way any web crawler or reader implementation can read it.
a) True
b) False
View Answer

Answer: a
Explanation: Microdata allows the user to create “custom” elements (sort of), to give a specific meaning to them. Microdata is an HTML specification is used to add more information to HTML. The Microdata spec provides a standardized syntax for additional semantic markup to your web pages to enhance the machine readability of your web pages.

Sanfoundry Global Education & Learning Series – HTML.

To practice all areas of HTML Problems, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.