Change the placeholder color of a text input using JavaScript or, better yet, CSS? [duplicate]

1

I want to change the color of the placeholder of this input. Is it possible?

<input type="text" placeholder="Enter your input here">
    
asked by Sanxofon 09.05.2018 в 06:01
source

1 answer

2

With css:

::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
    color: red;
    opacity: 1; /* Firefox */
}

:-ms-input-placeholder { /* Internet Explorer 10-11 */
    color: red;
}

::-ms-input-placeholder { /* Microsoft Edge */
    color: red;
}
    
answered by 09.05.2018 / 06:09
source