<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>form表单</title>

</head>

<body>

<!--form表单

input输入框

type定义input类型

name定义控件名称,必备属性

value定义控件的数据值

size定义input宽度

readonly定义input为只读属性,只能看不能输入

required定义输入框为必填项,不填无法提交

select下拉框属性selected表示默认选中

form属性

name表单命名

method规定表单数据提交方式

get

post

action定义表单被提交时发生的动作,通常包含服务方脚本的URL,即指向服务器的文件路径

enctype表单数据进行编码的方式,指定表单数据可以提交的类型

值一般为multipart/form-data

有此属性值form表单可以提交任何数据,没有则只能提交文本数据类型

-->

<form action="">

姓名:<input type="text" name="name" maxlength="15" />

<font color="red">*请输入用户名,最多15位</font>

<br /><br />

密码:<input type="password" name="password" maxlength="10" />

<font color="red">*请输入密码,最多10位</font>

<br /><br />

性别:    

<input type="radio" name="sex" />男    

<input type="radio" name="sex" />女    

<input type="radio" name="sex" checked/>保密    

<br /><br />

邮箱:<input type="email" size="20" />

<br /><br />

爱好:    

<input type="checkbox" name="hobby" />吃饭    

<input type="checkbox" name="hobby" />睡觉    

<input type="checkbox" name="hobby" />打豆豆    

<input type="checkbox" name="hobby" />斗地主    

<input type="checkbox" name="hobby" />打麻将    

<input type="checkbox" name="hobby" checked/>抽烟    

<input type="checkbox" name="hobby" checked/>喝酒    

<input type="checkbox" name="hobby" checked/>烫头    

<br /><br />

<input type="submit" name="tijiao" value="提交" />

<input type="reset" name="chongzhi" value="重置" />

<input type="button" name="button" value="普通按钮" />

</form>

</body>

</html>