Handy jQuery plugin for clearing an input field on focus. Found this a while ago on bassistance blog.
Plugin for clearing input field on focus
$.fn.clearOnFocus = function() { return this.focus(function() { if( this.value == this.defaultValue ) { this.value = ""; } }).blur(function() { if( !this.value.length ) { this.value = this.defaultValue; } }); };
You can clear the input field by using:
$(document).ready(function(){
$('span.sb-question-cbox').click(function(){
$(this).toggleClass('sb-question-cbox-selected');
});
$('input.email').clearOnFocus();
});
Comments (0)
Leave a comment...