How do you change a placeholder's attributes and styles?

Possible Duplicate:
Change an input's HTML5 placeholder color with CSS
Change font-color of placeholder span on input focus

Placeholder Attributes and Styles

How do you change a placeholder's styles?

For example:(font-family,size,color,etc.)


jQuery $('.class').css('color', '#334455'); same for the other CSS properties


This can be done with css. Have a look at the answer here. Change an HTML5 input's placeholder color with CSS

More or less use

input:-webkit-input-placeholder {
    color:    #999;
}
input:-moz-placeholder {
    color:    #999;
}
input:-ms-input-placeholder {
    color:    #999;
}
链接地址: http://www.djcxy.com/p/12162.html

上一篇: 根据元素的输入更改只读背景颜色

下一篇: 你如何改变占位符的属性和样式?