You can use the css pseudoclass :focus, but the support for it is pretty poor. Check out the support chart for it [here]. I probably shouldn't say that the support is poor, it's just that IE doesn't like it at all.
__________________
"God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "
Here is an example of how you can control the appearance of a textarea using CSS and JavaScript event handlers:
Code:
<style>
.txt_red{
background-color:red;
color:white;
}
.txt_blue{
background-color:blue;
color:yellow;
}
</style>
<textarea class="txt_blue" onfocus="this.className='txt_red'" onblur="this.className='txt_blue'" cols="30" rows="7">The style of this text area is dynamically controlled</textarea>