
Design comparison
Solution retrospective
Any ideas how to change the placeholder color with JavaScript? Any suggestions are welcome.
Community feedback
- @KapteynUniversePosted 5 months ago
Does it have to be with JS? You can easily change it with CSS.
input::placeholder { color: tomato; }
You can also change input value style based on valid or invalid
input:not(:placeholder-shown):valid { color: green; }
input:not(:placeholder-shown):invalid { color: red; }
Marked as helpful0@KapteynUniversePosted 5 months agoOh @erntTt94, an addition, i used green and red colors for example but they are not good together for some color blindness types. You might wanna change the colors or use other indicators like a success and error icon, text etc.
1
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord