How to change placeholder color on click event?

This question already has an answer here:

  • Change an HTML5 input's placeholder color with CSS 31 answers

  • You can't really modify pseudo-selectors with JavaScript. You'll have to modify an existing a element.

    If possible, make a class:

    .your-class::-webkit-input-placeholder {
        color: #b2cde0
    }
    

    And add it to the element:

     $('input').addClass('your-class');
    
    链接地址: http://www.djcxy.com/p/12172.html

    上一篇: 如何在html中改变输入占位符的颜色

    下一篇: 点击事件如何更改占位符颜色?