表单
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>表单form</title>
</head>
<body>
<form action="http://192.168.111.3:8080/oa/save" >
<input type="submit" value="登录"/>
<input type="button" value="设置按钮上显示的文本"/>
</form>
<br>
<form action="http://www.baidu.com">
<input type="text" />
<input type="submit" value="百度" />
</form>
<br>
<form action="http://localhost:8080/jd/save">
用户名<input type="text" /><br>
密码<input type="password" /><br>
<input type="submit" value="登录" />
</form>
<br>
<form action="http://localhost:8080/jd/save">
<table>
<tr>
<td>用户名</td>
<td><input type="text" name="username"/></td>
</tr>
<tr>
<td>密码</td>
<td><input type="password" name="userpwd"/></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit" value="登录" />
<input type="reset" value="清空" />
</td>
</tr>
</table>
</form>
<br>
<form></form>
</body>
</html>
用户注册表单的实现
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>用户注册的表单</title>
</head>
<body>
<form action="http://localhost:8080/jd/register" method="post">
用户名
<input type="text" name="username"/>
<br>
密码
<input type="password" name="userpwd"/>
<br>
确认密码
<input type="password"/>
<br>
性别
<input type="radio" name="gander" value="1"/>男
<input type="radio" name="gander" value="0" checked />女
<br>
兴趣爱好
<input type="checkbox" name="interest" value="smoke"/>抽烟
<input type="checkbox" name="interest" value="drink" checked />喝酒
<input type="checkbox" name="interest" value="fireHair"/>烫头
<br>
学历
<select name="grade">
<option value ="gz">高中</option>
<option value ="dz">大专</option>
<option value ="bk" selected>本科</option>
<option value ="ss">硕士</option>
</select>
<br>
简介
<textarea rows="10" cols="60" name="introduce"></textarea>
<br>
<input type="submit" value="注册" />
<input type="reset" value="清空" />
</form>
<a href="http://localhost:8080/oa/save?username=zhangsan&password=111">提交</a>
</body>
</html>
下拉列表支持多选
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>下拉列表支持多选</title>
</head>
<body>
<select multiple="multiple" size="2">
<option>河北省</option>
<option>河南省</option>
<option>山东省</option>
<option>山西省</option>
</select>
</body>
</html>
form的控件
file控件
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>file控件</title>
</head>
<body>
<input type="file" />
</body>
</html>
hidden控件
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>hidden控件</title>
</head>
<body>
<form action="http://loaclhost:8080/oa/save">
<input type="hidden" name="userid" value="111" />
用户代码<input type="text" name="usercode" />
<input type="submit" value="提交" />
</form>
</body>
</html>
readonly和disabled
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>readonly和disabled</title>
</head>
<body>
<form>
用户代码<input type="text" name="usercode" readonly />
<br>
用户姓名<input type="text" name="username" disabled />
<br>
<input type="submi" value="提交数据" />
</form>
</body>
</html>
控件的maxlength属性
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>maxlength</title>
</head>
<body>
<input type="text" maxlength="3" />
</body>
</html>
HTML中的id属性
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML中元素的id属性</title>
</head>
<body>
<form id="myform">
<input type="text" name="username" id="username" />
<input type="password" name="userpwd" id="userpwd" />
</form>
</body>
</html>
HTML中的div和span
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>div和span</title>
</head>
<body>
<div id="div1">我是一个DIV</div>
<div id="div2">我是一个DIV</div>
<span id="span1">我是一个SPAN标签</span>
<span id="span2">我是一个SPAN标签</span>
<div id="div3">
<div>
<div>test</div>
</div>
</div>
</body>
</html>