Blogger Information
Blog 9
fans 0
comment 0
visits 7718
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
表单元素
漠漠
Original
811 people have browsed it

实例

<!DOCTYPE html>
<html>
<head>
	<title>表单元素</title>
	<meta charset="utf-8">
</head>
<body>
	<form action="demo.php" method="GET">
		<!-- 文本框 -->
		姓名:<input type="text" name="name" value="" placeholder="例如:张三"><br>
		<!-- 密码框 -->
		密码:<input type="password" name="password" value=""><br>
		<!-- 单选按钮 -->
		性别:<input type="radio" name="sex" value="male">男
		<input type="radio" name="sex" value="female">女
		<input type="radio" name="sex" value="secret" checked >保密
		<!-- 多选按钮 -->
		<br>
		爱好:<input type="checkbox" name="happy[]" value="movie" checked>看电影
			<input type="checkbox" name="happy[]" value="basketball">打篮球
			<input type="checkbox" name="happy[]" value="music" checked>听音乐
		<!-- 下拉列表 -->
		<br>
		级别:
		<select name="level" id="">
			<option value="0">小白</option>
			<option value="1">入门</option>
			<option value="2">进阶</option>
			<option value="3" selected>大牛</option>
		</select>
		<br>
		<!-- 文件上传 -->
		头像:<input type="file" name="photo" accept="image/*"><br>

		<!-- 文本域   comment是备注的意思  -->
		请留言:
		<textarea name="comment" id="" cols="30" rows="10" placeholder="我是文本域"></textarea>
		<br>
		<!-- 隐藏域 是用来传值的 如当前时间,用户ID等-->
		<input type="hidden" name="user_id">

		<!-- 按钮 -->
		<input type="submit" name="submit" value="提交">
		<input type="reset" name="reset" value="重置">
		<!-- <button type="submit">登录</button>当type属性为submit的时候按钮具有提交功能 当type属性为button的时候
			是一个普通按钮-->
		<button type="button">登录</button>


	</form>
	
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post