一:
表單是HTML中重要的組成部分,是網頁提供的一種交互式操作手段,主要用於採集和提交用戶的輸入信息。
二:
屬性 | 說明 |
name | 表單名稱 |
method | 表單發送方式 |
action | 表單處理程序提交地址 |
enctype | 表單編碼方式 |
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>無標題文檔</title>
</head>
<body>
<form method="post" action="index.php">
文本框:<input type="text" name="s"/><br/><br/>
密碼框:<input type="password" name="ps"/><br/><br/>
文件框:<input type="file" name="file"><br/><br/>
複選框:籃球<input type="checkbox">足球<input type="checkbox"><br/><br/>
<!--要寫上name值相等,才能夠有單選的效果-->
單選框:男<input type="radio" name="a">女<input type="radio" name="a"><br/><br/>
普通按鈕:<input type="button" value="aaa"><br/><br/>
<!--發送用戶信息-->
提交按鈕:<input type="submit" value="註冊"><br/>
重置按鈕:<input type="reset" value="重置"><br/>
圖像框:<input type="image" src="" >
列表框:
<select>
<option>上海</option>
<option>廣州</option>
<option>深圳</option>
</select>
文本域:<textarea rows="3" cols="2"><!--cols 控制列-->
</textarea>
文本框:<input type="text" value="請輸入" maxlength="5" readonly><!--value默認顯示的h值,maxlength控制最大的個數,readonly只讀-->
隱藏域:<input type="hidden"><!--無需用戶修改的,用戶看不到-->
</form>
</body>
</html>