- web.groovymark@gmail.com
- December 14, 2024
Question 01
What required <form> attribute specifies the manner in which the browser will send form data to a web server?
a) Action
b) Method
c) Enctype
d) Type
Correct Answer: b) Method
Explanation: The method attribute defines how data will be sent to the server, either as a GET or POST request.
Question 02
This required <form> attribute specifies the name and location of the CGI script used to process the form.
a) Action
b) Method
c) Enctype
d) CGI
Correct Answer: a) Action
Explanation: The action attribute specifies where the form data should be sent once it is submitted.
Question 03
What <form> method attribute value instructs the browser to append the form data to the URL for use in a query string?
a) Get
b) Post
c) Action
d) Enctype
Correct Answer: a) Get
Explanation: The get method appends form data to the URL, allowing it to be used in query strings.
Question 04
What <form> method attribute value allows sending more characters and is slightly more secure when submitting a web-based form?
a) Get
b) Post
c) Action
d) Enctype
Correct Answer: b) Post
Explanation: The post method allows larger amounts of data and is more secure than get because the data is not exposed in the URL.
Question 05
In HTML, what is a container?
a) A part of the document body with opening and closing tags
b) A script element
c) A form element
d) A hyperlink element
Correct Answer: a) A part of the document body with opening and closing tags
Explanation: A container is an HTML element that has both opening and closing tags and can contain other elements.
Question 06
In HTML, what is a parent container?
a) A container in which another element resides
b) A closing tag
c) A void element
d) A script element
Correct Answer: a) A container in which another element resides
Explanation: A parent container is an HTML element that contains another element within its opening and closing tags.
Question 07
Which of the following HTML elements are containers?
a) <div>, <img>, <span>
b) <footer>, <header>, <section>, <span>
c) <img>, <br>, <hr>
d) <head>, <meta>, <title>
Correct Answer: b) <footer>, <header>, <section>, <span>
Explanation: These elements act as containers that define different sections or parts of a webpage.
Question 08
Which HTML element is a block element with no semantic meaning?
a) <footer>
b) <div>
c) <section>
d) <span>
Correct Answer: b) <div>
Explanation: The <div> element is a block-level container with no semantic meaning, used for layout purposes.
Question 09
What type of HTML element fills the minimum space possible in the parent container and can only contain text or other inline elements?
a) Block Element
b) Inline Element
c) Form Element
d) Header Element
Correct Answer: b) Inline Element
Explanation: Inline elements take up only the necessary space and can contain text or other inline elements.
Question 10
What is the generic HTML element that creates inline containers and has no semantic meaning?
a) <div>
b) <span>
c) <header>
d) <section>
Correct Answer: b) <span>
Explanation: The <span> element is used to group inline elements, without giving them any semantic meaning.
Question 11
What types of elements can be inside a block element?
a) Only block elements
b) Only inline elements
c) Both inline and block elements
d) Only text
Correct Answer: c) Both inline and block elements
Explanation: Block elements can contain both inline and block elements.
Question 12
What types of elements can be inside an inline element?
a) Only block elements
b) Only inline elements
c) Both inline and block elements
d) Only text
Correct Answer: b) Only inline elements
Explanation: Inline elements can only contain other inline elements or text.
Question 13
What HTML element is used to facilitate information gathering for submission to a server?
a) <input>
b) <textarea>
c) <form>
d) <label>
Correct Answer: c) <form>
Explanation: The <form> element is used to collect user input for submission to a server.
Question 14
Which HTML attribute should be used if a <form> field contains binary data that the normal format of the query string is not sufficient to encode?
a) Method
b) Action
c) Enctype
d) Name
Correct Answer: c) Enctype
Explanation: The enctype attribute defines how form data should be encoded when submitted to the server.
Question 15
Which of the following are primary attributes for an <input> element?
a) Id, name, type, value, placeholder
b) Id, action, method, value, placeholder
c) Name, method, enctype, value, placeholder
d) Type, action, enctype, method, value
Correct Answer: a) Id, name, type, value, placeholder
Explanation: These are the main attributes used to define an <input> element’s behavior.
Question 16
What is the <input> type attribute value for a text box widget?
a) Textarea
b) Submit
c) Text
d) Button
Correct Answer: c) Text
Explanation: The text value defines a simple text box input field.
Question 17
Which HTML element should be used to produce a submit button in a form?
a) <button>
b) <input>
c) <form>
d) <label>
Correct Answer: b) <input>
Explanation: The <input> element with type="submit" is used to create a submit button in a form.
Question 18
Which <input> attribute allows the input to start with a default value?
a) Name
b) Placeholder
c) Value
d) Type
Correct Answer: c) Value
Explanation: The value attribute is used to set the default value of an <input> field.
Question 19
Which <input> attribute provides a hint to the user about the information being requested?
a) Value
b) Placeholder
c) Name
d) Type
Correct Answer: b) Placeholder
Explanation: The placeholder attribute displays a hint to the user within the input field before any text is entered.
Question 20
Which attribute inside the <label> element is used to associate the label with a widget?
a) Value
b) For
c) Id
d) Name
Correct Answer: b) For
Explanation: The for attribute associates a label with an input element by its ID.