I have the following jQuery code that detects if a user has clicked a search button but not typed anything in the text box, if so then they are focused on the textbox and the box turns red. What I want to do is when the user unfocuses (blur) from the textbox regardless of whether they have entered text or not then the box will return to its original color, at the moment it stays red.
code:
$('#submit').click(function()
{
if ( $('#q').val() == '' )
{
$('#q').focus().css('border-color', '#ff0000'); return false;
}
});