<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>好好学习天天向上</title>
</head>
<body>
用户名:<input type="text" value ="用户名"/><!--这是一个文本框--><br/>
密码:<input type="password" maxlength="6"/> <!-- 这是一个密码框 ctrl+/ maxlength密码的最大长度 --><br />
性别: <input type="radio" name ="sex" /> 女 <input type="radio" name ="sex" /> 男 <input type="radio" name ="sex" checkd ="checked" /> 人妖
<input type="radio" name ="sex1" /> 未知<!-- 单选框 如果是一组通过相同的name值来实现 sex与sex1名不一样,所以能选两个--><br />
爱好:<input type ="checkbox" name="hobby" checkd ="checked" />足球 <input type ="checkbox" name="hobby" />篮球 <input type ="checkbox" name="hobby" />排球 <!-- 复选框 可以同时选多个 checkd ="checked"为默认--><br />
搜索:<input type="button" value="搜索啥"> <!-- 普通按钮 --><br />
<input type="submit" value="提交表单"/> <!-- 提交按钮 -->
<input type="reset" value="重置表单"/> <!-- 重置按钮 --><br />
<input type="image" src="ta.jpg"/> <!--
图像按钮 --><br />
上传头像:<input type="file" /> <!-- 文件按钮 -->
</body>
</html>
input控件:<input />为单标签。type为最基本的属性。
type:text(属性值) 单行文本输入框
Password 密码输入框
Radio 单选按钮
Checkbox 复选框
Button 普通按钮
Submit 提交按钮
Reset 重置按钮
Image 图像形式的提交按钮
File 文件域
Name:由用户自定义 控件的名称
Value:由用户自定义 input控件中的默认文本值
Size:正整数 input控件中在页面中的显示宽度
Checked:checked 定义选择控件默认被选中的项
Maxlength:正整数 控制允许输入的最多字符数