HTML Questions & Answers – HTML5 Form Changes

This set of HTML Questions and Answers for Campus interviews focuses on “HTML5 Form Changes”.

1. Which of the following is not a type of attribute for input tag?
a) day
b) week
c) month
d) time
View Answer

Answer: a
Explanation: Day is not defined in the pre-defined attribute list of input tag. Week attribute defines week and year when used as attribute in input tag. Month specifies month and year when it is accessed in input tag. The time attribute displays current time in html.

2. The new __________ element is supposed to represent some form of extra details, such as a tooltip or revealed region that may be shown to a user.
a) progress
b) meter
c) details
d) menu
View Answer

Answer: c
Explanation: A scalar measurement within a range or fractional value is defined by meter tag. A list/menu of coommands is displayed by menu tag in html. The details tag specifies additional details that the user can view or hide on demand. The details tag can be used to create an interactive widget that the user can open and close. Any sort of content can be put inside the <details> tag. Progress of a task is done by progress element.

3. The __________ element may contain not just links but also other interactive items, including the newly introduced command element.
a) progress
b) meter
c) details
d) menu
View Answer

Answer: d
Explanation: A scalar measurement within a range or fractional value is defined by meter tag. The menu tag defines a list/menu of commands. The menu tag is used for context menus, toolbars and for listing form controls and commands. The details tag specifies additional details that the user can view or hide on demand. The details tag can be used to create an interactive widget that the user can open and close. Any sort of content can be put inside the <details> tag. Progress of a task is done by progress element.
advertisement
advertisement

4. The __________ attribute effectively renders the iframe as an inline include, which allows the parent document’s CSS to affect the contents of the iframe.
a) allow-forms
b) seamless
c) embed
d) allow-scripts
View Answer

Answer: b
Explanation: Embed attribute attach external content at a specified point in document. The seamless attribute is a boolean attribute. When present, it specifies that the iframe should look like it is a part of the containing document (no borders or scrollbars). Allow-forms re-enables from submission. Scripts are re-enabled by allow-scripts.

5. Which of the following allows the sandboxed iframe to run scripts from the same domain?
a) allow-same-origin
b) allow-forms
c) allow-scripts
d) allow-pointer-lock
View Answer

Answer: c
Explanation: Scripts are re-enabled by allow-scripts. The sandbox attribute enables an extra set of restrictions for the content in the iframe. Allow-forms re-enables from submission. Allow-same-origin allows iframe content to be treated as being from the same origin. API’s are re-enable by allow-pointer-lock.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. __________ allows the iframe to pull in content from elsewhere in the same domain.
a) allow-same-origin
b) allow-forms
c) allow-scripts
d) allow-pointer-lock
View Answer

Answer: a
Explanation: Scripts are re-enabled by allow-scripts. Allow-forms re-enables from submission. Allow-same-origin allows iframe content to be treated as being from the same origin. API’s are re-enable by allow-pointer-lock.

7. Which of the following is not a HTML5 added form element?

advertisement
a) <datalist>
b) <keygen>
c) <output>
d) <password>
View Answer
Answer: d
Explanation: <datalist>, <keygen> and <output> are HTML5 added form element. Element <password> is not a HTML5 added form element. Password is an attribute used in input type in HTML.
 
 
8. Which element specifies a list of pre-defined options for an input element?

a) <datalist>
b) <keygen>
c) <output>
d) <password>
View Answer
Answer: a
Explanation: The datalist tag is used to provide an “autocomplete” feature on input elements. Users will see a drop-down list of pre-defined options as they input data. Password defines password field in HTML. It is attribute for input-type. The <keygen> element references from data after form has submitted. Result of calculation (script) is represented by output tag.
 
 
9. Which of the following defines a group of related options in a drop-down list?

a) <form>
b) <optgroup>
c) <output>
d) <option>
View Answer
Answer: b
Explanation: HTML form element is used in its <form> tag having its own structure which is used by users for various tasks. If you have a long list of options, groups of related options are easier to handle for a user. Result of calculation (script) is represented by output tag. A drop down list of items is defined by <option> tag in HTML.
 
 
Sanfoundry Global Education & Learning Series – HTML.

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

advertisement

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.