inputDefault: a jQuery plugin to hide a default value on focus

Thursday 18th June 2009 at 9:03 pm

A free jQuery plugin to put the label of a text field inside the field itself, then make it disappear when the field is in focus with this jQuery plugin.

This script will remove the default value and change the colour of the font inside a text field when focused upon, then when focus is moved away, it will place the default value back in if the field is empty.

Particularly useful for login boxes such as those on Facebook.

Options

defaultColor: hexadecimal color for the text inside the field when the default value is displayed. (Default: #888).

activeColor: hexadecimal color for the text inside the field when the user is typing in the field. (Default: #000).

Download

The download contains the scripts required and an example HTML file showing various usage options.

Download the inputDefault plugin