Simple jQuery Plugin To Clear Input Field On Focus - autoclear

Simple jQuery Plugin To Clear Input Field On Focus - autoclear
File Size: 3.34KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

jQuery autoclear is a simple yet user-friendly jQuery plugin that automatically clear input (or textarea) field values on focus (or click). Similar to the HTML5 placeholder funcntion and the plugin works in pretty much any browser (IE6, IE7, IE8, etc.).

See also:

Basic Usage:

1. Load the latest jQuery javascript library and jQuery autoclear plugin at the bottom of your web page.

<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="jquery-autoclear.min.js"></script>

2. Create a text input filed. Using value and title attributes to create default values

<input type="text" class="demo" value="jQuery Script" title="jQuery Script" />

3. Call the plugin.

<script>
$(document).ready(function(){
    $('.demo').autoClear();
});
</script>

4. Style the input field via CSS. By default, a .focus_input class will be added to the input field on focus And a .modified_input class is added If it has changed


This awesome jQuery plugin is developed by kaayru. For more Advanced Usages, please check the demo page or visit the official website.