Example:html
<form action="demo_form.asp"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> <input type="submit" value="Submit"> </form>
Browser Support瀏覽器
The <input> tag is supported in all major browsers.ide
input標籤是被大多數的瀏覽器所支持的。
orm
Definition and Usagehtm
The <input> tag specifies an input field where the user can enter data.ip
input標籤,就是一個用戶能夠輸入數據的字段。ci
<input> elements ares used with a <form> element to declare input controls that allow users to input data.element
input元素是和form元素一塊兒使用做爲容許用戶輸入數據的輸入操做。get
An input field can vary in many ways , depending on the type attribute.input
input能夠有多種用法,由它的type屬性來決定。
Tips and Notes
Note: The <input> element is empty , it contains attributes only.
注意: input元素是空的,它只包含有屬性。
Tips: Use the <label> element to define labels for <input> elements.
技巧:使用<label>元素去定義<input>元素的標籤
Differences Between HTML 4.01 and HTML5
In HTML 4.01, the "align" attribute is deprecated , and it is not supported in HTML5. Use CSS to align <input> elements.
在HTML 4.01中,align屬性是棄用的,不同意使用的,而且這在HTML5是不被支持的。(可使用CSS排列<input>元素)
Attributes:
Attribute |
Value |
Description |
maxlength | number |
Specifies the maximum number of characters allowed in an <input> element |
size |
number |
Specifies the width , in characters , of an <input> element. |