jQuery Clearme Plugin Example

Markup requirements

 

Example:

<input type="text" title="Watermark text to show when field is empty" />

Example 1 - Default

$('#example-1').clearme();

Example 2 - One time clear

Clears field on first click.

$('#example-2').clearme({
	restoreValue:false
});

Example 3 - Leave firefox behavior alone

Leave firefox default behavior, that is, the current value of fields are restored on page refresh and not the initial value. Try changing the value and hit refresh (F5). Notice the value typed will remain in firefox.

$('#example-3').clearme({
	autocomplete:true
});

Example 4 - Textarea

Also applies to textareas

$('textarea').clearme();

Example 5 - HTML5 Email Field

$('input[type="email"]').clearme();

Example 6 - HTML5 Tel Field

$('input[type="tel"]').clearme();

Example 7 - HTML5 Url Field

$('input[type="url"]').clearme();

Example 8 - HTML5 Search Field

$('input[type="search"]').clearme();

Example 9 - HTML5 Number Field

$('input[type="number"]').clearme();