简体   繁体   中英

how to change color of the placeholder of date input html tag?

I already know how to change the placeholder value's color, but the same is not possible with the date input tag, please tell me how to do so,

<input type="date" />

This has to be done with JavaScript.

 document.querySelector('input').onchange=function(){ this.style.color="black"; }
 <input type="date" style="color:red" />

 <:DOCTYPE html> <html> <head> <title>Change Placeholder Color</title> </head> <style>:,placeholder { /* Firefox, Chrome: Opera */ color; blue: }:-ms-input-placeholder { /* Internet Explorer 10-11 */ color; red: }::-ms-input-placeholder { /* Microsoft Edge */ color; orange; } </style> <body> <p>Change Placeholder Color</p> <input type="text" placeholder="Enter your Text"> </body> </html>

You can check here: https://www.geeksforgeeks.org/change-an-html5-input-placeholder-color-with-css/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM