300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > input标签里面type常用属性(注册登录表单常用元素)

input标签里面type常用属性(注册登录表单常用元素)

时间:2021-08-20 20:53:27

相关推荐

input标签里面type常用属性(注册登录表单常用元素)

之前写一些小项目的时候,在表单这一块因为知道的type属性就text、password、button、submit等一些值,而且form表单也应用的不是很灵活,所以通过简单的学习,认识到以前写的form表单有多搞笑(连type=data都不知道)。

现在,就对form表单里常用的元素进行整理。

上述表单就是一些常用的表单元素,如有不足,欢迎雅正!

再更新一些:

新增的input type属性值:

常用新属性

下面在给出一个简单的html例子作为参考

<!DOCTYPE html><html><head><meta charset="utf-8" /><title></title></head><body><!--<table width="600" border="1px" cellpadding="0" cellspacing="0"><caption><h4>青春不常在,抓紧谈恋爱</h4></caption></table>--><form action=""><!--当一组表单元素放到fieldset标签内时,浏览器会以特殊的方式来显示它们,它们可能有特殊的边界、3D效果,或者甚至可创建一个子表单来处理这些元素--><fieldset><!--legend元素为fieldset元素定义的标题--><legend>学生档案</legend><label for="userName">姓名:</label><input type="text" name="userName" id="userName" placeholder="请输入用户名"> <br><label for="userPhone">手机号码:</label><input type="tel" name="userPhone" id="userPhone" pattern="^1\d{10}$"><br><label for="email">邮箱地址:</label><input type="email" required name="email" id="email"><br><label for="collage">所属学院:</label><input type="text" name="collage" id="collage" list="cList" placeholder="请选择"><br><datalist id="cList"><option value="前端与移动开发学院"></option><option value="java学院"></option><option value="c++学院"></option></datalist><br><label for="score">入学成绩:</label><input type="number" max="100" min="0" value="0" id="score"><br><form action=""><fieldset><legend>学生档案思密达</legend><label>姓名: <input type="text" placeholder="请输入学生名字"/></label> <br /><br /><label>手机号: <input type="tel" /></label> <br /><br /><label>邮箱: <input type="email" /></label> <br /><br /><label>所属学院: <input type="text" placeholder="请选择学院" list="xueyuan"/><datalist id="xueyuan"><option>java学院</option><option>前端学院</option><option>php学院</option><option>设计学院</option></datalist><br /><br /><label>出生日期: <input type="date" /></label> <br /><br /><label>成绩: <input type="number" /></label> <br /><br /><label>毕业时间: <input type="date" /></label> <br /><br /><input type="submit" /> <input type="reset" /></fieldset></form><label for="inTime">入学日期:</label><input type="date" id="inTime" name="inTime"><br><label for="leaveTime">毕业日期:</label><input type="date" id="leaveTime" name="leaveTime"><br><input type="submit"></fieldset></form></body></html>

展示界面

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。