jQuery change placeholder text color

前端 未结 5 949
甜味超标
甜味超标 2020-12-05 23:35

Is it possible to use \"::-webkit-input-placeholder\" with jQuery to set a color for the placeholder text?

Something like this:

$(\"input::-webkit-in         


        
5条回答
  •  一整个雨季
    2020-12-06 00:06

    Just add this. It will inherit the color in input[type=text]:focus new color

    .your-class ::placeholder{ color: inherit;}
    

提交回复
热议问题