textarea 标签
textarea 代表 html 表单多行输入域
textarea 标签是成对出现的, 以 < textarea > 开始, 以 </textarea > 结束
属性:
cols -- 多行输入域的列数
rows -- 多行输入域的行数
accesskey -- 表单的快捷键访问方式
disabled -- 输入域无法获得焦点, 无法选择, 以灰色显示, 在表单中不起任何作用
readonly -- 输入域可以选择, 但是无法修改
tabindex -- 输入域, 使用 "tab" 键的遍历顺序
示例
- <form action="/demo/demo_form.asp">
- <textarea name="abc">
- abc
- </textarea>
- <br>
- <br>
- <input type="submit" value="Submit">
- </form>
服务器接收到的用户输入为:
abc=abc
- function post(URL, PARAMS) {
- var temp = document.createElement("form");
- temp.action = URL;
- temp.method = "post";
- temp.style.display = "none";
- for (var x in PARAMS) {
- var opt = document.createElement("textarea");
- opt.name = x;
- opt.value = PARAMS[x];
- // alert(opt.name)
- temp.appendChild(opt);
- }
- document.body.appendChild(temp);
- temp.submit();
- return temp;
- }
来源: http://www.jianshu.com/p/eb992ae90c31