Sunday, 24 July 2016

HTML TextArea, Label Element

TextArea Element
This element allows us to enter multiple line of information. It is similar to textbox but textbox allows us to enter in the single line.

Attributes of TextArea

  • cols- refers to the visible width of textarea control.
  • rows- refers to the number of rows in the textarea control.
  • disabled- disabled the textarea.
  • name- refers to the name of the textarea.
  • readonly- specifies that the textarea is read-only and you cannot write in it.
  • accesskey- refers to the shortcut key on the keyboard.
  • autofocus- allows the control too get focus as soon as the page loads.
  • dirname- specifies the name of the input control that indicates the text direction of the textarea.
  • placeholder- helps the user to fill the respective textarea by providing hint for the input.
  • required- specifies that the value of input field is mandatory.
  • wrap- allows the textarea to wrap the text.
Label Element
It allows us to add the description of the control. Each label element is associated with exactly on e control.

Attributes of Label Element
  • for- associates the label with a specific control. the value of this attribute must match the id attribute of its associated control.
  • form- refers to the id of the form.

example

<!Doctype Html>
<html>
<body>
<h1>TextArea and Label Element</h1>
<form>
<label id="lbldescription" for="txtarea">TextArea Description :</label><br/>
<textarea id="txtarea" cols="30" rows="7" wrap="wrap">
This is text Area control. Please 
enter your multiline text here.
It is different from textbox because it 
allows multine text to be entereed.
</textarea>
</form>
</body>
</html>


0 comments:

Post a Comment