jQuery Resettable Plugin
Overview
Resettable is an extremely basic jQuery plugin designed to make prefilled input fields (of type “text”) switch to being empty when they receive focus, and switch back to their initial value when they lose focus if they have been left blank. There are no configuration options.
Invoking Resettable: Examples
It doesn’t get much easier than this:
$("input#email").resettable();
$("form#register input").resettable();
That’s pretty much it. Resettable will iterate over each element in the specified jquery object, store its initial val(), and attach a behavior that hides/redisplays that initial value on focus/blur. Pretty straightforward, really.
Get it!
Download: jquery.resettable.js
Feedback & Support
Resettable is in very early development: your feedback will help make it better (provided you supply meaningful information) and I welcome hearing about resettable’s use. Please contact me via email.