Learn how to use Button, Select tag, Text area tag to make form in HTML - Technology & Web designing

Breaking

Tuesday, 5 May 2020

Learn how to use Button, Select tag, Text area tag to make form in HTML



Button :

Using type=button, button can be created. But this button is used for clicking and activating a fuction. It does not submit data in the form

<Form>

<Input type="button" value="Click">

</Form>

The above HTML code looks in a browser :


The <Select> Tag :

The <select>------</select> tag allows the user to select an option from menu kind of drop-down list or scrolling list box.

Each item in the drop-list can be created using <option>------</option> tag which is used within <select> tag. The closing </option > tag is optional. You can use VALUE attribute with each <option> tag to assign a value to each option.

Attribute of <Select> Tag :

  • Name : Is used to assign the label to selection. This helps to identify which item user has selected.
  • Size : Allows to specify the number of list items to be displayed at one time. E.g. size = value
  • Multiple : It is used to select more than one selection from the same list.

To display the option as default selected option SELECTED attribute with <option> tag is used. If this is not included, the form display the first element listed as default selected choice.

Let's understand with an example

Programe :



Output :



The <Textarea> Tag :

The <Textarea>-------</Textarea> is used to create multiple textbox or large editable area. It is useful in those forms where you want detailed feedback with mutiline entries.

Attribute of <Textarea> tag :

  • Name = "text" : attribute sets the name of the textarea to the script on the server when the form is submitted.
  • Cols = "number" : specifies the width of the text entry area as columns.
  • Rows = "number" : Specifies the height of the text entry area as rows.

Let's understand with an example

Programe :



Output :

No comments:

Post a Comment

If you have any doubts regarding this please comment or email us.