元素<form>
相關屬性包括
- <form action="action_page.php">
action 屬性是要傳遞到的服務器地址怎栽,不填寫默認傳遞當前頁面 - <form method="GET">
method屬性是規(guī)定傳遞數(shù)據(jù)的方式,有post與get兩種
簡單來說儒溉,get用于提交簡單內(nèi)容歹苦,大小受限,且安全性不好边灭。
post無大小限制,安全性好健盒,適用于較大數(shù)據(jù)文件的提交绒瘦。
其他屬性
元素<input>
- <input type="text"> 文本屬性
- <input type="password">密碼屬性
- <input type="submit" value="submit"> 提交屬性
- <input type="radio"> 單選屬性
- <input type="checkbox"> 定義復選框称簿。
- <input type="button> 定義按鈕
- <input type="date"> 定義用于應該包含日期的輸入字段(data、week惰帽、month憨降、time、datetime善茎、local-datetime;
-
<input type="number">用于應該包含數(shù)字值的輸入字段券册。
QQ截圖20160820210751.png
元素select 下拉列表
<select name="cars">
<option value="volvo">V'olvo</option>
<option value="fiat" selected>Fiat</option>
</select>
通過添加selected屬相,選擇預選項
元素<textarea>文本域
<textarea name="message" rows="10" cols="30">
The cat was playing in the garden.
</textarea>
元素<button>
<button type="button" onclick="alert('Hello World!')">Click Me!</button>
文本域
元素<fieldset><legend>
<fieldset>
<legend>Personal information:</legend>
QQ截圖20160820140755.png
輸入限制