The question is in the subject.
input[type='text']:focus { background-color: #0066FF; }
You can use the CSS pseudo-class selector as follows:
textarea:focus { background-color: red }
Please note that this does not work IE7 and below .
Demonstration:)
textarea:focus { background-color: #00ff00; }