您当前位置: 南顺网络>> 官方资讯>> 建站知识

input属性及其应用

实现打电话和发送短信:

<a href="tel:10086">拨打10086</a>

<a href="sms:10086">发短信</a>

 

<input type="submit" value="Submit" />                                                    

//加onfocus="if(value=='密码') {value=''}" onblur="if (value=='') {value='密码'}" data-role="none" 

type的类型:                                                                                                                                                     

type为以上属性是input可用的属性:           

通用type=“”属性:                                                                           autocomplete="off"或"on";浏览器基于之前输入过的值,应该显示出在字段中填写的选项。

  E-mail: <input type="email" name="email" autocomplete="off"/>                                                                                                autofocus="autofocus"可以直接简写autofocus;打开页面自动获取input的焦点。(不适   用于 type="hidden")list="";

前提有datalist标签才能用如:                                           

  <form action="/example/html5/demo_form.asp">

网页:<input type="url" list="url_list" name="link" />

<datalist id="url_list">

<option label="W3School" value="http://www.w3school.com.cn" />

<option label="Google" value="http://www.google.com" />

<option label="Microsoft" value="http://www.microsoft.com" />

</datalist>

<input type="submit" />

  </form>                                                                                                                                                                                                                                                                                                      

type="file"时:                                                                                     

<input type="file" name="pic" id="pic" accept="image/gif, image/jpeg"/>      

限定图像上传的格式为gif和jpeg,如果不限制图像的格式,可以写为:accept="image/*"   其效果就是点击上传时,被上传的文件夹里的图片只有限定的格式图片会显示,其他的不显示        multiple="multiple"属性规定输入字段可选择多个值,上传的图片可以是多张。

                                                                                                                               

手机端调用摄像头加capture  


<input type="file" capture />或

<input type="file" capture="camera" accept="image/*"/> 手机拍照和上传图片


bootstrap去掉获取焦点时有虚边

.form-control:focus,input:focus{

outline: none;

box-shadow: none;

}


编辑:--ns868