Using textarea
In this recipe we will take a look at the textarea
element and create a simple form to show some of the attributes that can be used. textarea
is intended for use as a multiple line plain-text editing control.
How to do it...
We will create an example form
to demonstrate some of the uses of the textarea
element:
First we add a
texarea
element with theplaceholder
attribute set:<form> <label>Short info: <textarea placeholder="some default text"></textarea> </label>
Then we add a textarea with the
rows
andcols
attributes set:<label> Info with default size set: <textarea rows="4" cols="15" placeholder="some default text"></textarea> </label>
Then we add one with
maxlength
set:<label> Max area limited to 5 characters <textarea maxlength="5" placeholder="Inset text here limit 5 char"></textarea> </label>
Then we add one with the
title
attribute set:<label> Tip on hover <textarea...