<form> 標(biāo)簽用于為用戶輸入創(chuàng)建 HTML 表單。
表單能夠包含 input 元素,比如文本字段、復(fù)選框、單選框、提交按鈕等等。
表單還可以包含 menus、textarea、fieldset、legend 和 label 元素。
表單用于向服務(wù)器傳輸數(shù)據(jù)。
注釋:form 元素是塊級(jí)元素,其前后會(huì)產(chǎn)生折行。
<form action="form_action.html" method="get">
<p>First name: <input type="text" name="fname" /></p> <p>Last name: <input type="text" name="lname" /></p> <input type="submit" value="Submit" /></form>
NONE
屬性 | 值 | 描述 | DTD |
---|---|---|---|
action | URL | 規(guī)定當(dāng)提交表單時(shí),向何處發(fā)送表單數(shù)據(jù)。 | STF |
屬性 | 值 | 描述 | DTD |
---|---|---|---|
accept | MIME_type | 規(guī)定通過文件上傳來提交的文件的類型。 | STF |
accept-charset | charset | 服務(wù)器處理表單數(shù)據(jù)所接受的字符集。 | STF |
enctype | MIME_type | 規(guī)定表單數(shù)據(jù)在發(fā)送到服務(wù)器之前應(yīng)該如何編碼。 | STF |
method |
|
規(guī)定如何發(fā)送表單數(shù)據(jù)。 | STF |
name | name | 規(guī)定表單的名稱。 | TF |
target |
|
規(guī)定在何處打開 action URL。 | TF |
id, class, title, style, dir, lang, xml:lang
如需完整的描述,請(qǐng)?jiān)L問標(biāo)準(zhǔn)屬性。
onsubmit, onreset, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
如需完整的描述,請(qǐng)?jiān)L問事件屬性。
如對(duì)本文有疑問,請(qǐng)?zhí)峤坏浇涣髡搲瑥V大熱心網(wǎng)友會(huì)為你解答??! 點(diǎn)擊進(jìn)入論壇