Page 139 - Viva ICSE Computer Studies 7 : E-book
P. 139
Input Tag and Its Attributes
Input tag is used to create form elements. Its attributes are as follows.
• Type: The type attribute specifi es the type of input elements to be added in a form.
Text is the default type .
• Name: The name attribute specifi es a unique name given to each input element.
• Value: The value attribute specifi es the initial values to be assigned.
• Size: The size attribute specifi es the width of
the input fi eld. Think and Discuss
• Maxlength: The maxlength attribute specifi es
Which are the two important attributes
the maximum number of characters that can be that are used to set up a form?
entered in an input fi eld.
Adding a Textbox
Textbox is used when you want the user to type letters and numbers in a form.
Syntax: <Input type=”Text”>
Adding a Checkbox
Checkboxes are used to select one or more options. The checked attribute causes the checkbox
to be checked (preselected), when the form is displayed. If checked attribute is specifi ed with
any of the choices, then that particular choice will be checked by default. Checkboxes allow
multiple values to be selected.
Syntax: <Input type=”Checkbox”>
127