email类型:

<input type="email">

url类型:

<input type="url">

date类型:

<input type="date">

time类型:

<input type="time">

month类型:

<input type="month">

week类型:

<input type="week">

number类型:

<input type="number">

range类型:

<input type="range">

search类型:

<input type="search">

color类型:

<input type="color">

placeholder属性:

<input type="text" placeholder="点击输入">

autofocus属性(获取焦点):

<input type="text" autofocus="true">

list属性:

<input type="text" list="ilist">
<datalist id="ilist">
    <option label="1" value="1">
    <option label="2" value="2">
    <option label="3" value="3">
</datalist>

pattern属性(正则验证):

<input type="text" required pattern="^[1-9]\d{5}$">

required属性(必填)

<input type="text" required>

外部提交表单(提交按钮可在表单外面)

<form action="" id="iform">
    <input type="text" name="name">
</form>
<input type="submit" form="iform" value="提交">

 

posted on 2017-02-06 18:44  怀素真  阅读(2027)  评论(0编辑  收藏  举报