Change input background color on Focus

To do this, use the :focus pseudo-class and specify the background color you want to use.

<style>
    input:focus {
        background: red;
    }
</style>

Example:

<style>
    input:focus {
        background: #eee;
    }
</style>

<input type="text" value="hello">

Output (click on the input):