jQuery change placeholder text color

前端 未结 5 959
甜味超标
甜味超标 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-05 23:49

    I was using MaterializeCSS; I used Jquery to update CSS for input fields like this

      $(".input-field").css("color", themeColor);
      $(".input-field>.material-icons").css("color", themeColor);
      $(".input-field>label").css("color", themeColor);
    

    See Result:

    https://codepen.io/hiteshsahu/pen/EXoPRq?editors=1000

提交回复
热议问题