Code
Execute
<
!DOCTYPE
html
>
<
html
>
<
body
>
Enter the text:
<
input
type
="text"
id
="tutorials"
onkeydown
= "Wikitechy()"
>
<
script
>
function
Wikitechy()
{
document.getElementById(
"tutorials"
).style.backgroundColor =
"green"
;
}
<
/script
>
<
/body
>
<
/html
>
<!DOCTYPE html> <html> <body> Enter the text: <input type="text" id="tutorials" onkeydown= "Wikitechy()" > <script> function Wikitechy() { document.getElementById("tutorials").style.backgroundColor ="green"; } </script> </body> </html>
Result