Here is a real quick fix for that annoying blinking cursor in an input field. This is a very bad practice for accessability, and should be thought about before use.
<input type="text" name="" class="input">
.input{
color: transparent;
text-shadow: 0 0 0 red;
}
.input:focus{
outline: none;
}
Want to change the text color? Simply update the text-shadow color in the CSS. For example, to make the text blue, you would use:
text-shadow: 0 0 0 blue;
Removing the blinking cursor can hinder accessibility, making it harder for users to know where they are typing. Consider the user experience and accessibility implications before implementing this fix.
And there you have it! A super simple way to remove the blinking cursor from your input fields. Use this trick wisely, and always keep accessibility in mind. Got any questions or alternative methods? Drop them in the comments below!
Hi, I am Full Stack Developer. I am passionate about JavaScript, and find myself working on a lot of React based projects.