Web Technology Questions and Answers – Form Accessibility and Structure

This set of Web Technology Multiple Choice Questions & Answers (MCQs) focuses on “Form Accessibility and Structure”.

1. How does a Fieldset element helps in source code?
a) Creates a border around the group of form controls to show that they are related
b) Creates a field where the number of selecting check boxes can be modified
c) They are used to label the text boxes in a particular field mentioned
d) They are used to unrelate a group of form controls which might look similar
View Answer

Answer: a
Explanation: Large forms can be confusing for users, so it ’ s good practice to group together related form controls. The <fieldset> element is one of the way to structure the form. It creates a border to show that the form controls are related.

2. What is a legend element?
a) Element takes the control over the <fieldset> element
b) This element allows you to specify a caption for the <fieldset> element
c) They are used to break the groups to let them stand individually in forms
d) It is used to create a finalized identity which cannot be modified any further
View Answer

Answer: b
Explanation: The <legend> element allows you to specify a caption for the <fieldset> element, which acts as a title for the group of form controls. When used, the <legend> element should always be the first child of the <fieldset> element.

3. If you use a table to format your form, the entire <table> element must appear inside which element?
a) legend element
b) fieldset element
c) table element itself
d) object element
View Answer

Answer: b
Explanation: If you use a table to format your form, the entire <table> element must appear inside the <fieldset> element. If a <fieldset> resides within a table that is used to format the page, then the entire fieldset must reside within the same cell.
advertisement
advertisement

4. Which attribute does a legend element not contain?
a) accesskey
b) noalign
c) Universal attributes
d) UI event attributes
View Answer

Answer: b
Explanation: There is no ‘noalign’ attribute existing. Instead, align attribute can be a value for legend element. Remember, when you use the <legend> element, it must be the first child of the <fieldset> element.

5. What is a tabindex attribute?
a) Used to jump from one element to another by skipping one
b) Fast and efficient way to index the objects
c) Used to control the order in which elements can gain focus
d) Used to jump from one element to another by skipping a tab space elemets
View Answer

Answer: c
Explanation: You can use the tabindex attribute to give that element a number between 0 and 32767, which becomes part of the tabbing order. Every time the user presses the Tab key, the focus moves to the element with the next highest tabbing order.

6. What is the default value for tabindex attribute?
a) No default value
b) Any value greater than zero
c) One
d) zero
View Answer

Answer: d
Explanation: Elements that could gain focus but do not have a tabindex attribute are automatically given a value of 0. Therefore, when you specify a tabindex value, it should be 1 or higher, rather than 0.If an element is disabled, it cannot gain focus and does not participate in the tabbing order.

7. What happens if two elements have the same tabindex value?
a) They will not be navigated at all
b) They will be navigated simultaneously
c) They will be navigated in the order in which they appear in the document
d) It lets the user decide to navigate to which element
View Answer

Answer: c
Explanation: If two elements have the same value for a tabindex attribute, they will be navigated in the order in which they appear in the document. So, once the elements that have a tabindex of 1 or more have been cycled through, the browser will cycle through the remaining elements in the order in which they appear in the page.
advertisement

8. Which Form control work with the readonly attribute?
a) <select>
b) <option>
c) <textarea>
d) <button>
View Answer

Answer: c
Explanation: The readonly attribute prevents users from changing the value of the form controls themselves, although it may be modified by a script. The name and value of any readonly control will be sent to the server. The value of this attribute should be readonly.

9. What happens when the form element doesn’t carry method attribute?
a) The get method will be used as default
b) The source code won’t display anything on executing/implementing
c) The post method will be used as default
d) The preget method will be used as default
View Answer

Answer: a
Explanation: The <form> element does not carry a method attribute, then by default the get method will be used. If you are using a file upload form control, you must choose the post method (and you must set the enctype attribute to have a value of multipart/form – data).
advertisement

10. The URL with any spaces or unsafe characters such as /, \, =, & , and + are replaced by?
a) Replaced by a question mark
b) Replaced with a hex code to represent that character
c) They are not replaced
d) They are replaced by hash sign
View Answer

Answer: b
Explanation: When a browser requests a URL with any spaces or unsafe characters such as /, \, =, &, and + (which have special meanings in URLs), they are replaced with a hex code to represent that character. This is done automatically by the browser, and is known as URL encoding.

Sanfoundry Global Education & Learning Series – Web Technology.

To practice all areas of Web Technology, 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.