Onclick Change Input Text Field Background Color in HTML

by on July 9th, 2007

While clicking in input text field of a form in HTML you can change its background color as in the the following example:

Place this code in head of your page

and

Input Text Field Code

Don’t forget to use script tags for head section: javascript part and change the color value in script accordingly.