# HTML Form Elements
● The <input> Element
The most important form element is the <input> element.
This element can be displayed in several ways, depending on the type attribute.
● The <select> Element
The <select> element defines a drop-down list.
The <option> elements defines an option that can be selected.
By default, the first item in the drop-down list is selected.
To define a pre-selected option, add the selected attribute to the option.
● The <textarea> Element
The <textarea> element defines a multi-line input field.
● The <button> Element
The <button> element defines a clickable button.
● HTML5 Form Elements
HTML5 added the following form elements.
- <datalist>
- <keygen>
- <output>
● HTML5 <datalist> Elements
The <datalist> element specifies a list of pre-defined options for an <input> element. Users will see a drop-down list of the pre-defined options as they input data.
The list attribute of the <input> element, must refer to the id attribute of the <datalist> element.
● HTML5 <keygen> Elements
The purpose of the <keygen> element is to provide a secure way to authenticate users.
This element specifies a key-pair generator field in a form.
When the form is submitted, two keys are generated, one private and one public.
The private key is stored locally, and the public key is sent to the server.
The public key could be used to generate a client certificate to authenticate the user in the future.
● HTML5 <output> Elements
The <output> element represents the result of a calculation.
No comments:
Post a Comment