HTML元素 - input

定义

创建各种表单输入控件。

Creates a variety of form input controls.

注释

INPUT 元素的 TYPE 标签属性用于表示下列表单输入控件:

buttoncheckboxfilehiddenimage
passwordradioresetsubmittext

此元素是一个内嵌元素。

此元素不需要关闭标签。

The TYPE attribute for the INPUT element is used to specify one of the following form input controls:

buttoncheckboxfilehiddenimage
passwordradioresetsubmittext

This element is an inline element.

This element does not require a closing tag.

示例代码

<FORM ACTION="http://intranet/survey" METHOD=POST>
<P>Name<BR><INPUT NAME="CONTROL1" TYPE=TEXT VALUE="Your Name"></P>
<P>Password<BR><INPUT TYPE="PASSWORD" NAME="CONTROL2"></P>
<P>Color<BR>
<INPUT TYPE="RADIO" NAME="CONTROL3" VALUE="0" CHECKED>Red
<INPUT TYPE="RADIO" NAME="CONTROL3" VALUE="1">Green
<INPUT TYPE="RADIO" NAME="CONTROL3" VALUE="2">Blue
<P>Comments<BR>
<INPUT TYPE="TEXT" NAME="CONTROL4" SIZE="20,5" MAXLENGTH="250">
<P><INPUT NAME="CONTROL5" TYPE=CHECKBOX CHECKED>Send receipt</P>
<P><INPUT TYPE="SUBMIT" VALUE="OK"><INPUT TYPE="RESET" VALUE="Reset"></P>
</FORM>

另见

button, select, textArea

相关教程和示例代码

HTML表单