html5-表單

<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Document</title>
	<script type="text/javascript">
		window.onload = function()
		{
			var one = document.getElementById("ones");
			
			one.onchange = function()
			{
					var s = one.value;
					console.log(s);	
			}
		}
	</script>
</head>
<body>
	<form action="" method="post" id="form">
		
       郵箱:<input type='email' id="" value="" />	<br />
	url:<input type="url" name="" id="" value="" /> <br />
number: <input type="number" min="1" max="10" name="" id="" value="" /> <br />

		<!--滑塊-->
		<input type="range" name="" min="1" max="100" step="1" value="1" id="ones"/>   
		<br />
		
		<!--日期時間-->
		<input type="datetime-local" name="" id="" value="" />
		<br />
		
		<!--顏色-->
		<input type="color" name="" id="" value="" />
		<br />
		
		<!--自動匹配-->
		<input type="text" name="" id="" value="" list="list"/>
		<datalist id="list">
			<option value="北京">北京</option>
			<option value="南京">南京</option>
			<option value="西京">西京</option>
		</datalist>
		<br />
		
		<!--自動獲取焦點-->
		<input type="text" autofocus="on" name="" id="" value="" />
		
		
		
		
		
		
		
		
		<input type="submit" value="提交"/>
	</form>
	
	
	<!--提交form表單之外的表單-->
	<input type="password" name="pass" id="pass" value="" form="form"/>
</body>
</html>



發佈了2 篇原創文章 · 獲贊 2 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章