form表单 input输入框及属性 课堂笔记

<!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 />
			性别:&nbsp;&nbsp;&nbsp;&nbsp;
			  <input type="radio" name="sex" />男&nbsp;&nbsp;&nbsp;&nbsp;
			  <input type="radio" name="sex" />女&nbsp;&nbsp;&nbsp;&nbsp;
			  <input type="radio" name="sex" checked/>保密&nbsp;&nbsp;&nbsp;&nbsp;
			  <br /><br />
			邮箱:<input type="email" size="20" />
				<br /><br />
			爱好:&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="checkbox" name="hobby" />吃饭&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="checkbox" name="hobby" />睡觉&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="checkbox" name="hobby" />打豆豆&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="checkbox" name="hobby" />斗地主&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="checkbox" name="hobby" />打麻将&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="checkbox" name="hobby" checked/>抽烟&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="checkbox" name="hobby" checked/>喝酒&nbsp;&nbsp;&nbsp;&nbsp;
				<input type="checkbox" name="hobby" checked/>烫头&nbsp;&nbsp;&nbsp;&nbsp;
				<br /><br />
				<input type="submit" name="tijiao" value="提交" />
				<input type="reset" name="chongzhi" value="重置" />
				<input type="button" name="button" value="普通按钮" />
		</form>
	</body>
</html>

猜你喜欢

转载自blog.csdn.net/S_1978P1/article/details/81351791