input元素
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>input元素</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form action="http://www.crazyit.org" method="get">
单行文本框:<input id="username" name="username" type="text" /><br />
不能编辑的文本框:<input id="username2" name="username" type="text" readonly="readonly" /><br />
密码框:<input id="password" name="password" type="password" /><br />
隐藏域:<input id="hidden" name="hidden" type="hidden" /><br />
第一组单选框:<br />
<input id="color" name="color" type="radio" value="red" />
<input id="color2" name="color" type="radio" value="green" />
<input id="color3" name="color" type="radio" value="blue" /><br />
第一组单选框:<br />
<input id="gender" name="gender" type="radio" value="male" />
<input id="gender2" name="gender" type="radio" value="female" /><br />
两个复选框:<br />
<input id="website" name="website" type="checkbox" value="leegang.org" />
<input id="website2" name="website" type="checkbox" value="crazyit.org" /><br />
文件上传域:<input id="file" name="file" type="file" /><br />
图像域:<img id="image" src="Images/logo.jpg" alt="logo图片" style="width:15px;" /><br />
下面是四个按钮:<br />
<input id="ok" name="ok" type="submit" value="提交" />
<input id="dis" name="dis" type="submit" value="提交" disabled="disabled" />
<input id="cancel" name="cancel" type="reset" value="重填" />
<input id="no" name="no" type="button" value="无动作" />
</form>
</body>
</html>
截图如下:
注意:
当用户点击提交按钮,网页跳转后,URL显示分别如下:
1) http://www.crazyit.org/?username=&username=&password=&hidden=&file=&ok=%E6%8F%90%E4%BA%A4
因为该表单时通过GET方式发送请求的,所以请求参数名,参数值被追加到URL后面。
转载于:https://www.cnblogs.com/peter-Blog/archive/2013/05/02/3055486.html