0
点赞
收藏
分享

微信扫一扫

form表单——2.表单元素

诗与泡面 2022-02-08 阅读 88
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<form action="" method="get">
			<!--表单元素-->
			<!--文本框
				input标签使用很广泛,通过type属性的不同值,来表现不同的形态
				type="text" 文本框, 里面的文字可见
				表单元素中必须有一个属性:name 有了name才可以提交数据
				然后提交的时候会以键值对的形式拼接到一起
				value:就是文本框中的具体内容
				如果value提前写好,默认为value
				默认提示语为placeholder属性,而value为文本框中的值
				
				readonly:you cannot do it
				disabled:you cannot use it
			-->
			<input type="text" name="uname" placeholder="请录入身份证信息"/>
			<input type="text" name="uname2" value="123123" readonly="readonly"/>
			<input type="text" name="uname3" value="456456" disabled="disabled"/>
			
			<!--密码框:录入不可见-->
			<input type="password" name="pwd" />
			<!--单选标签 attention: a set of radio use a botton of control-->
			<!-- we dif it by name, usually background dif it by value, dif chosen control by dif value
				checked is chosen 
			-->
			<input type="radio" name="gender" value="1" checked="checked"/>男
			<input type="radio" name="gender" value="0"/>女
			<!--多选按钮:
				you must use the value to control ,and put them in one set, then you can choose many of them
				and if you choose use it, it seems like &
			-->
			The language you like:
			<input type="checkbox" name="favlan" value="1" checked="checked"/>java
			<input type="checkbox" name="favlan" value="2" checked="checked"/>python
			<input type="checkbox" name="favlan" value="3"/>php
			<input type="checkbox" name="favlan" value="4"/>c#
			<!--特殊按钮:提交按钮,具备提交功能-->
			<input type="submit" />
		</form>
	</body>
</html>
举报

相关推荐

0 条评论