<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>html表单</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<form action="success.html" method="post">
<div class="all">
<div class="left_images">
<img src="images/left_image.jpg" alt="">
</div>
<div class="content">
<h3>学员信息登记表</h3>
<div>
<label align="right">用户登录名:</label>
<input type="email" disabled value="myemail@163.com">
<span>(不能修改,只能查看)</span>
</div>
<div>
<label align="right">   真实姓名:</label>
<!-- <input type="text" placeholder="例如:王明" onkeyup="value=value.replace(/[\d]/g,'') "
onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[\d]/g,''))">-->
<input type="text" placeholder="例如:王明" pattern="[\u4e00-\u9fa5]{2,5}" required>
<span>(必须填写,只能输入汉字)</span>
</div>
<div>
<label align="right">   真实年龄:</label>
<!--<input type="number" value="" pattern="[1-9][0-9]{0,1}" required>-->
<input type="number" value="" min="0" max="150" class="input" required>
<span>(必须填写)</span>
</div>
<div>
<label align="right">   出生日期:</label>
<input type="date" class="input" required>
<span>(必须填写)</span>
</div>
<div>
<label align="right">   电子邮箱:</label>
<input type="email" placeholder="123456@126.com" required>
<span>(必须填写)</span>
</div>
<div>
<label align="right">   身份证号:</label>
<input type="text" pattern="^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2]\d)|(3[0-1]))((\d{4})|(\d{3}[Xx]))$" required>
<!--<input type="text" pattern="([0-9]|X|x)$" required>-->
<span>(必须填写,能够以数字、字母x结尾的短身份证号)</span>
</div>
<div>
<label align="right">   手机号码:</label>
<input type="tel" pattern="^(0|86|17951)?1[0-9]{10}" required>
<span>(必须填写)</span>
</div>
<div>
<label align="right">   个人主页:</label>
<input type="url" list="index" placeholder="http://www.itcast.cn">
<datalist id="index">
<option value="http://www.baidu.com"></option>
<option value="http://www.souhu.com"></option>
<option value="http://www.qq.com"></option>
</datalist>
<span>(请选择网址)</span>
</div>
<div>
<label align="right">   幸运颜色:</label>
<input type="color" class="color">
<span>(请选择你喜欢的颜色)</span>
</div>
<input type="submit" value="提交" class="submit">
<input type="reset" value="重置" class="reset">
</div>
<div class="bird">
<img src="images/bird.jpg" alt="">
</div>
</div>
</form>
</body>
</html>
html5部分新增表单元素的使用
最新推荐文章于 2021-08-06 10:56:34 发布