HTML Questions & Answers – Elements and Attributes to Support Web Applications

This set of HTML Multiple Choice Questions & Answers (MCQs) focuses on “Elements and Attributes to Support Web Applications”.

1. What does ‘On-Screen Action’ means in the testing of HTML5 applications?
a) Using Drag action
b) Using new input type
c) Using play and pause action of audio and video elements
d) Verifying SVG and Canvas elements
View Answer

Answer: a
Explanation: While testing of HTML5 for a browser i.e. whether its elements are supported by the browser or not one can use draggable content using Drag action and this action can be called through On-Screen Action operation.

2. What can be used to verify a displayed graphics?
a) Property checkpoints
b) Region checkpoints
c) On-Screen Action
d) Local STorage
View Answer

Answer: b
Explanation: Region checkpoints are used to verify a displayed graphics. It is a kind of test operation which gives verification of application’s window or control is displayed correctly or not. Object’s property is verified by region checkpoints which is test operation. Local storage is for storing data.

3. Which element has been removed from HTML5 (W3C) specification?
a) <figure>
b) <nav>
c) <hgroup>
d) <aside>
View Answer

Answer: c
Explanation: A section that is tangentially related to its surrounding content is defined by <aside> tag. A block of navigation links is provided by newly added element in HTML5 called <nav>. <hgroup> tag has been removed from HTML5 specification, but it can be seen in WHATWG version of HTML. The purpose of this element is how headings are displayed. It’s practice is limited to theory only. <figure> tag specifies its own self defined content which may contain diagrams, photos etc.
advertisement
advertisement

4. Which of the following is used for plug-in content?
a) <embed>
b) <progress>
c) <meter>
d) <source>
View Answer

Answer: a
Explanation: <embed> tag is new in HTML5 which also helps in validation of HTML5 page. It has attributes like height, src, type and width. HTML4 does not support this tag. Multiple media sources for video , audio and pictures are provided by <source> tag. <meter> tag gives a scalar measurement within a particular range. Progress of a task is shown by <progress> element.

5. Which of the following does not lie under the attribute of <input> and is not supported by Opera?
a) url
b) time
c) tel
d) option
View Answer

Answer: d
Explanation: <input> element type has new values as ‘url’, ‘email’, ‘datetime’, ‘date’, ‘month’, ‘tel’, ‘time’, ‘number’, ‘search’, ‘color’, ‘range’, ‘datetime-local’, ‘week’.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Which is the new attribute of <input> element that is used to change the appearance of checkbox?
a) Indeterminate
b) Media
c) EI
d) Target
View Answer

Answer: a
Explanation: The indeterminate is actually not an attribute, it is the property of checkbox which can be change via JavaScript, e.g. Var checkbox=document.getElementById(“any-checkbox”); Checkbox.indeterminate=true;

7. Which attribute does not lie inside <a> and <area> elements?
a) Media
b) Ping
c) Hreflang
d) Preload
View Answer

Answer: d
Explanation: Preload is the attribute of the <video> element. Media, ping, hreflang, rel are the attribute used with <a> and <area> elements.
advertisement

8. Which element does not support autofocus attribute?
a) <input>
b) <select>
c) <textarea>
d) <base>
View Answer

Answer: d
Explanation: Autofocus is a new attribute as well as very interesting one. It can be specified on <input>, <textarea>, <button> and <select> elements. It is a way to focus a form control when the page is loaded.

9. Which element does not support form attribute?
a) <input>
b) <output>
c) <meta>
d) <button>
View Answer

Answer: c
Explanation: The new form attribute is for <input>, <select>, <textarea>, <button>, <output> and <fieldset>. One can place these elements anywhere on the page.
advertisement

10. Which attribute of <input> element can be used both with <datalist> and <select> elements?
a) List
b) Pattern
c) Multiple
d) Max
View Answer

Answer: a
Explanation: List is the new attribute of <input> element and can be used together with <datalist> and <select> elements. Other attributes like pattern, multiple, max, min, step are new attribute used with the <input> element only.

11. Which is not a Boolean attribute?
a) Multiple
b) Novalidate
c) Formvalidate
d) Formtarget
View Answer

Answer: d
Explanation: Formtarget attribute is a Boolean attribute that must have a value that is a valid browsing context name. Multiple is a new Boolean attribute of <input> the element which specifies constraint, novalidate, and formvalidate are <form> attribute and are Boolean as well.

12. Which of the following is not the keyword of form method attribute?
a) GET
b) POST
c) PUT
d) OUT
View Answer

Answer: d
Explanation: The keyword GET, POST, PUT, DELETE mapped to the state GET, POST, PUT, DELETE and indicating the HTTP method respectively.

13. What is the work of async attribute?
a) It influences script loading
b) It gives a label to the menu
c) It validates form data
d) Enables a set of extra restrictions on any content
View Answer

Answer: a
Explanation: Async is the new attribute of the <script> element which influences script loading and its execution. It is a Boolean attribute which shows the manner of script execution. If async is present, the script will be executed asynchronously, as soon as it is available.

14. Which is not <iframe> attribute?
a) Seamless
b) Srcdoc
c) Sizes
d) Sandbox
View Answer

Answer: c
Explanation: Sizes is the attribute of <link> element. Sandbox is the attribute of <iframe> element that enables a set of extra restrictions on any content, seamless is a Boolean attribute of <iframe> which seamlessly included in the parent document, srcdoc attribute gives the content of the page that the nested browsing context is to contain.

15. Which is not a new global attribute in HTML5?
a) Contenteditable
b) Contextmenu
c) Title
d) Draggable
View Answer

Answer: c
Explanation: Contenteditable, contextmenu, data, draggable, hidden, role, aria, spellcheck all are new global attributes introduced in HTML5. Class, dir, id, lang, style, tabindex, title are the attributes of HTML4 and now specified as global in HTML5.

Sanfoundry Global Education & Learning Series – HTML.

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

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

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.