I need to perform a function when a user comes out of focus. So far I can do it when they go into focus but how do I do it the other way round:
$("input.default-value").focus(function() {
$(this).css("color", active_color);
});
You’re looking for .blur()
Of course, i’d recommend using classes to add the css.
but i digress..
(and if you don’t care about ie7 and under, you can use the :focus pseudo-class)