HTML Multiple Choice Questions & Answers on HTML and XHTML Element Reference for Freshers

https://www.computersprofessor.com/2017/11/html-multiple-choice-questions-answers_26.html
1. Which attribute specifies a unique alphanumeric identifier to be associated with an element?
a) class
b) id
c) article
d) html
Answer: b
Explanation: The id attribute is most used to point to a style in a style sheet, and by JavaScript (via the HTML DOM) to manipulate the element with the specific id.
2. The _____________ attribute specifies an inline style associated with an element, which determines the rendering of the affected element.
a) dir
b) style
c) class
d) none of the mentioned
Answer: b
Explanation: The style attribute will override any style set globally, e.g. styles specified in the style tag or in an external style sheet.
3. Which attribute is used to provide an advisory text about an element or its contents.
a) tooltip
b) dir
c) title
d) none of the mentioned
Answer: c
Explanation: The information is most often shown as a tooltip text when the mouse moves over the element.
4. The __________ attribute sets the text direction as related to the lang attribute.
a) lang
b) sub
c) dir
d) ds
Answer: c
Explanation: The dir attribute specifies the text direction of the element’s content.
5. Which of the following is the attribute that specifies the column name from the data source object that supplies the bound data?
a) dataFormatAs
b) datafld
c) disabled
d) datasrc
Answer: b
Explanation: datafld attribute specifies the column name from the data source object that supplies the bound data. This attribute is specific to Microsoft’s data binding.
6. Which of the following is the attribute that indicates the name of the data source object that supplies the data that is bound to this element?
a) dataFormatAs
b) datafld
c) disabled
d) datasrc
Answer: d
Explanation: When the dataSrc property is applied to a tabular data consumer, the entire data set is repeated by the consuming elements.
7. Which of the following is the attribute that specifies additional horizontal space, in pixels, to be reserved on either side of an embedded item like an iframe, applet, image, and so on?
a) height
b) hspace
c) hidefocus
d) datasrc
Answer: b
Explanation: The hspace attribute specifies the whitespace on left and right side of an object.
8. The accesskey attribute specifies a keyboard navigation accelerator for the element.
a) True
b) False
Answer: a
Explanation: The accesskey attribute specifies a shortcut key to activate/focus an element.
9. Which of the following is the attribute that is used to set a global identifier for a microdata item?
a) key
b) id
c) itemclass
d) itemid
Answer: d
Explanation: It allows a vocabulary to define a global identifier for a microdata item, for example an ISBN number on a book. Use itemid on the same element as the item’s itemscope and itemtype attributes.
10. Which of the following is the attribute that is used to add a name/value pair to a microdata item?
a) itemscope
b) itemref
c) itemprop
d) itemid
Answer: c
Explanation: To add a property to an item, the itemprop attribute is used on one of the item’s descendants. Markup without the microdata-related attributes does not have any effect on the microdata model.