Button Tag
The button tag creates a push button. Regular XHTML contents, like text and images can be put in a button. This is the difference between the buttons created by this tag and the buttons created by input tag. This button tag is similar to the button tag used in HTML.
Attributes of Button Tag
Name
It sets the name of the button tag. It works like it works in other tags.
Example |
<button name=”new” > New! </button> |
| |
Type
The button tag creates one of the three buttons given below:
- Button (as default) creates a normal button like a button is created with the input tag.
- Submit creates a submit button like a submit button created with the input tag.
- Reset creates a reset button like a reset button created with the input tag.
Example |
|
<button type=button> Hello! </button> |
<button type=submit> Send It! </button> |
<button type=reset> Reset This! </button> |
| |
Label Tag
The label tag defines a label to a control. When the text within the label is clicked, it will toggle the control. The <label> tag in HTML is exactly similar to the <label> tag in XHTML.
Attribute of Label Tag
For
It defines the form element to which the label is associated. The text used in for attribute in label, should be same as the text in the id attribute of the control.
Example |
<label for=”moreinfo”> Do you want more information? </label> |
<input type=checkbox name=”moreinfo” id=”moreinfo” /> |
| |
TextArea Tag
The TextArea tag indicates a form field where the user can enter a large amount of text. An unlimited number of characters can be written in the text-area. The default font of text area is fixed pitch. This tag is also exactly similar in its usage with HTML.
Attributes of Textarea Tag
Name
Name sets the name of the form field. It works in a similar way as the input field.
Example |
<textarea name=”comments” > </textarea> |
| |
Cols and Rows
Cols indicate how many characters wide the textarea should be. Rows indicate how many rows should be present in the textarea. It does not set any limit to how much text can be typed in, it just sets how much area is visible.
Example |
<textarea name=”comments” cols=40 rows=6 > </textarea> |
| |
Wrap
Wrap describes how the text-area wraps at the end of lines.
- Soft
It wraps long lines in the text area for easy editing. It does not send the carriage return to the server.
- Hard
It looks similar to soft, but it sends the carriage returns to the server.
- Off
Off does not wrap at all. It just displays and sends the text exactly as typed in.
Example |
<textarea name=”comments” wrap=soft> </textarea> |
| |
|