placeholder文字颜色与是否显示兼容性
1.ie显示问题
<script type="text/javascript">
$(document).ready(function(){
var doc=document,
inputs=doc.getElementsByTagName('input'),
supportPlaceholder='placeholder'in doc.createElement('input'),
placeholder=function(input){
var text=input.getAttribute('placeholder'),
defaultValue=input.defaultValue;
if(defaultValue==''){
input.value=text
}
input.onfocus=function(){
if(input.value===text)
{
this.value=''
}
};
input.onblur=function(){
if(input.value===''){
this.value=text
}
}
};
if(!supportPlaceholder){
for(var i=0,len=inputs.length;i<len;i++){
var input=inputs[i],
text=input.getAttribute('placeholder');
if(input.type==='text'&&text){
placeholder(input)
}
}
}
});
</script>
2.文字颜色问题
命名class控制color
placeholder文字颜色与是否显示兼容性的更多相关文章
- [BS-19]更改UITextField的placeholder文字颜色的5种方法
更改UITextField的placeholder文字颜色的5种方法 想要达到的目标是:一个页面上有多个UITextField,当用户聚焦某textField时,该文本框的placeholder的文字 ...
- input placeholder 文字颜色修改
placeholder 文字颜色修改 input::-webkit-input-placeholder{ color:red; } input::-moz-placeholder{ /* Mozill ...
- 修改placeholder文字颜色
.area_ipt ::-webkit-input-placeholder { /* WebKit browsers */ color:#258aca; } .area_ipt :-moz-place ...
- input的placeholder文字颜色修改
input::-webkit-input-placeholder { color: #D6D0CA !important; /* WebKit browsers / } input:-moz-plac ...
- input修改placeholder文字颜色
少废话,上代码: <style> input::-webkit-input-placeholder{ color:red; } input::-moz-placeholder{ /* Mo ...
- 修改input标签placeholder文字颜色
input::-webkit-input-placeholder, textarea::-webkit-input-placeholder { /* WebKit browsers */ color: ...
- 如何更改placeholder属性中文字颜色
如何更改placeholder属性中文字颜色 placeholder这个属性是HTML5中新增的属性,该属性的作用是规定可描述输入字段预期值的简短的提示信息,该提示会在用户输入之前显示在输入字段中,会 ...
- UITextField的placeholder文字的位置,颜色等的自定义设置
//控制placeHolder的位置,左右缩20 -(CGRect)placeholderRectForBounds:(CGRect)bounds { CGRect inset = CGRectMak ...
- 修改输入框placeholder文字默认颜色-webkit-input-placeholder
html5为input添加了原生的占位符属性placeholder,高级浏览器都支持这个属性,例如: <input type="text" placeholder=" ...
随机推荐
- LeetCode之389. Find the Difference
-------------------------------------------------- 先计算每个字母的出现次数然后减去,最后剩下的那一个就是后来添加的了. AC代码: public c ...
- unity3d中串口的使用
工作中遇到了串口的问题,通过查资料&实验写出了下面代码: 关于串口的代码我在网上看了好多,一种是用事件来做,另外一种使用线程来做:(经过试验,unity无法用串口自带的事件进行数据读取): 看 ...
- 使用Navicat 导入导出Mysql数据库
1 导出 另外一种方式 2 导入,新建数据名称 3 导入,运行sql文件(步骤1中的) 推荐使用SQLyog进行导入数据比较好
- 解决SVN更新代码是出现previous operation has not finished; run cleanup if it was interrupted这个错误
解决方法:清空svn的队列 1.下载sqlite3.exe 2.找到你项目的.svn文件,查看是否存在wc.db (查看.svn文件需要打开显示隐藏文件夹) 3.将sqlite3.exe放到.sv ...
- 《DSP using MATLAB》示例Example5.9
代码: n = 0:10; x = 10*(0.8) .^ n; y = x(mod_1(-n,11)+1); %% ----------------------------------------- ...
- C#(委托a)
C#(委托a) public delegate double TheOperator(double x, double y); public class Operators { static publ ...
- 从Bayesian角度浅析Batch Normalization
前置阅读:http://blog.csdn.net/happynear/article/details/44238541——Batch Norm阅读笔记与实现 前置阅读:http://www.zhih ...
- Android入门(七):Spinner下拉式菜单组件
对于手机和平板电脑的应用程序来说,打字是非常不方便的操作方式,比较好的方式就是列出一组选项让用户挑选,这样就可以避免打字的麻烦.使用Spinner下拉菜单组件需要完成以下几个步骤: 1.建立选项列表, ...
- YUM源设置
1挂载光盘 先创建一个文件 /aaa 然后挂载mount /dev/cdrom /aaa 进入 /aaa ls 查看是否挂载OK 2进入yum文件夹.将除Media以外的所有文件名改为XXXXXX ...
- UVa #11582 Colossal Fibonacci Numbers!
巨大的斐波那契数 The i'th Fibonacci number f (i) is recursively defined in the following way: f (0) = 0 and ...