HTML forms

一、概述

html 的form元素以及form中的输入元素,如input, button, select等在客户端编程中占有很重要的位置。form起源于web之初,先于javascript存在。form元素获取用户的输入,并把输入提交到服务器,服务器生成新的页面返回给客户端显示。

HTML 元素                                                    Type 属性                  事件处理器      描述                                                                              
<input type="button"> or <button type="button"> "button" onclick 按钮
<input type="checkbox"> "checkbox" onchange 复选按钮
<input type="file"> "file" onchange 输入要上传到服务器的文件名的控件,value属性是只读的
<input type="hidden"> "hidden" none 上传到服务器的数据,但是在UI上不显示
<option> none none select对象中的一个对象,事件处理器在select对象上。
<input type="password"> "password" onchange 密码输入控件,输入的内容不可见
<input type="radio"> "radio" onchange 单选按钮
<input type="reset"> or <button type="reset"> "reset" onclick 重置按钮
<select> "select-one" onchange 列表或下拉框,只能选一个
<select multiple> "select-multiple" onchange 列表,可以多选
<input type="submit"> or <button type="submit"> "submit" onclick 提交按钮
<input type="text"> "text" onchange 单行文本输入框,未指定type时,input的默认type
<textarea> "textarea" onchange 多行文本输入框

posted on 2013-11-15 14:38  leungrs  阅读(176)  评论(0编辑  收藏  举报