![]() |
VOOZH | about |
In this article, we will find how to set a different color for each letter in a text field using jQuery?
Approach:
To do this we will have to change the color of text whenever the user enters a letter using the keyboard. For this, we will use onkeydown event that triggers whenever the user presses a key on the keyboard.
Syntax:
object.onkeydown = function(){Script}
Example: Let us look at an example to find how to set a different color for each letter in a text field using jQuery onkeydown event.
Output: