网络学院 w3pop社区 网络资源 IT新闻

w3pop.com :: 网络学院 :: HTML :: HTML <textarea>标签

会员登陆

帐号

密码

回答

记住密码

忘记密码? 注册

HTML <textarea>标签


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-28 浏览:2348 :: ::

定义与用法

Defines a text-area (a multi-line text input control). A user can write text in the text-area. In a text-area you can write an unlimited number of characters. The default font in the text-area is fixed pitch.
定义文字输入区域(多行文字输入的input控件)。用户可以在里面书写文字。字数没什么限制。默认的字体是固定的。


在HTML和XHTML中的区别

NONE


实例

代码 输出结果
<textarea rows="2" cols="20">
The cat was playing in the garden. Suddenly a dog showed up.....
</textarea>


必要属性

DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
下表中的DTD列指明了被支持的DTD属性。S=Strict(精确的),T=Transitional(传统的),F=Frameset(框架)

属性 描述 DTD
cols number Specifies the number of columns visible in the text-area
指定在文字区域内可见的列数
STF
rows number Specifies the number of rows visible in the text-area
指定在文字区域内可见的行数
STF

可选属性

属性 描述 DTD
disabled disabled Disables the text-area when it is first displayed
当第一次加载的时候文字区域不可用
STF
name name_of_textarea Specifies a name for the text-area
指定文字区域的name
STF
readonly readonly Indicates that the user cannot modify the content in the text-area
文字区域内的内容不可修改
STF

标准属性

id, class, title, style, dir, lang, xml:lang, tabindex, accesskey

For a full description, go to Standard Attributes.
查看完整的属性

事件属性

onfocus, onblur, onselect, onchange, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

For a full description, go to Event Attributes.
查看完整的属性


尝试与演示

Textarea
How to create a text-area.
怎样建立文字区域

评论 (0) All