We will be needing a js file and a page containing form input field to do this task. What we are planning to do is, The input field contains default value. Onclick default value disappears and allows the user to insert text. If the user types anything it remains there but if he does not write anything and clicks at next input field than the default value reappears in previous field.
Some times you want that when the contact form be loaded, its focus should be in the first form field where user will start typing. For that you need to know that form name, the field name to focus and you need to call onload in the body tag of the web page. Let’s try an example:
While clicking in input text field of a form in HTML you can change its background color as in the the following example: