This code allows you to easily set the focus and blur CSS class on form elements using jQuery.
// Set focus and blur CSS class for the following fields and field types $("input, textarea, select").addClass("idle"); $("input, textarea, select").focus(function(){ $(this).addClass("activeField").removeClass("idle"); }).blur(function(){ $(this).removeClass("activeField").addClass("idle"); });
There are no comments for this post.