HTML5 的placeholder属性(兼容各版本)
来源:互联网 发布:mysql和oracle的分页 编辑:程序博客网 时间:2024/05/16 03:22
Placeholder是HTML5新增的另一个属性,当input或者textarea设置了该属性后,该值的内容将作为灰字提示显示在文本框中,当文本框获得焦点时,提示文字消失。
placeholder 点击可下载(写好的案例)
其它情况:
当在IE10以下版本中占位文本的颜色是黑色;IE10以上版本(其它浏览器最新版本)为灰色,为了兼容IE10以下版本(老版本)统一让占位符更改为灰色,建议可以利用以下方法更改占位文本颜色值。
基本代码:
<input type="text" value="placeholder text" onfocus="this.style.color='#000';
this.value='';" style="color: #f00;"/>
完善代码:
<input type="text" value="placeholder text" onfocus="if(!this.haswriting){this.style.color='#000'; this.value='';}" onblur="if(!this.value){this.style.color='#f00'; this.value='placeholder text'; this.haswriting=false;}else{this.haswriting=true};" style="color: #f00;"/>
0 0
- HTML5 的placeholder属性(兼容各版本)
- html5的placeholder属性(IE如何兼容placeholder属性)
- IE兼容html5的placeholder属性(IE如何兼容placeholder属性)
- Html5的placeholder属性(IE兼容)
- 兼容ie10以下版本的placeholder属性
- html5 placeholder ie版本兼容
- HTML5 的 PLACEHOLDER 属性
- html5 Placeholder属性兼容IE6、7方法
- Html5 placeholder 兼容(不支持的浏览器ie)
- HTML5里的placeholder属性
- HTML5里的placeholder属性
- HTML5里的placeholder属性
- IE兼容实现HTML5的placeholder
- html5新属性 placeholder
- HTML5----placeholder属性
- html5--placeholder属性
- HTML5中的placeholder属性
- html5兼容IE placeholder问题
- 用Eclipse的SVN管理Android的问题
- 想在自己的android应用中获得当天的天气情况,这该怎么做呢?不用担心。中国国家气象局提供了获取所在城市天气预报信息接口。通过这个接口,我们就可以获取天气信息了。
- Android 权限
- ASIHTTPRequest开源类项目导入问题及解决方法
- MongoDB Linux下的安装和启动
- HTML5 的placeholder属性(兼容各版本)
- MongoDB JAVA API更新数据示例
- nginx不支持apk ipa文件下载
- linux下定时执行计划crond任务
- MongoDB权限
- Linux下PHP-APC的安装与配置
- 安装redis版本为1.2.6
- CentOS fastDFS结合nginx的配置以及php端的调用方法
- mongodb分布式集群架构