Zebra ClearInput

A tiny jQuery plugin for enhancing web forms by allowing users to easily clear values in text input boxes


Download View on GitHub

No configuration required.

                    $(document).ready(function() {

                        // the argument is a selector of input fields you want to attach the plugin to
                        // in this example, all the text input fields
                        var clearInput = new $.Zebra_ClearInput('input[type="text"]');

                    });
                    

Start typing in the text field below to see the option for clearing the value appear.
Once the input looses focus, the option for clearing the value will appear only when the mouse moves over the text field.

A smaller input size...

A larger input size...

                    $(document).ready(function() {

                        // remove the plugin from all text inputs
                        // (this assumes that previously the plugin was
                        // instantiated and held in the "clearInput" variable)
                        clearInput.destroy();

                    });
                    
                    $(document).ready(function() {

                        // enable the plugin on all text inputs
                        var clearInput = new $.Zebra_ClearInput('input[type="text"]');

                    });