1D0-61B · Question #35
You can use the HTML <input>, <select> and <text area> tags to create form fields in a Web page by placing them between the <form> /form> container tags. Which attribute is used with the <input>…
The correct answer is A. The type attribute. The type attribute on <input> determines what kind of field renders - type="text" gives a text box, type="checkbox" a checkbox, type="radio" a radio button, type="submit" a button, and so on - making it the attribute that designates which form field appears. Without type, the…
Question
You can use the HTML <input>, <select> and <text area> tags to create form fields in a Web page by placing them between the <form> /form> container tags. Which attribute is used with the <input> element to designate the fields that will appear in the form?
Options
- AThe type attribute
- BThe name attribute
- CThe value attribute
- DThe action attribute
How the community answered
(35 responses)- A89% (31)
- B3% (1)
- C6% (2)
- D3% (1)
Explanation
The type attribute on <input> determines what kind of field renders - type="text" gives a text box, type="checkbox" a checkbox, type="radio" a radio button, type="submit" a button, and so on - making it the attribute that designates which form field appears. Without type, the browser has no way to know what control to draw. The name attribute (B) is used to identify the field's data when the form is submitted, not to designate the field type itself. The value attribute (C) sets the default or submitted value of a field, not its visual type. The action attribute (D) belongs on the <form> tag, not <input>, and specifies the URL where form data is sent.
Memory tip: Think Type = Type of control - the type attribute is the one that transforms a generic <input> tag into a specific, visible field.
Topics
Community Discussion
No community discussion yet for this question.