I have the following problem: I have a form with three text input fields, and I want to change the background-color when one of the fields has focus, and get it set back whe
What you are trying to do can be simplified down to this.
$('input:text').bind('focus blur', function() { $(this).toggleClass('red'); });
input{ background:#FFFFEE; } .red{ background-color:red; }