﻿(function ($) {
    $.fn.extend({
        defaultInputText: function (options) {

            var defaults = {
                defaultText: 'default text goes here'             
            };
            var options = $.extend(defaults, options);

            return this.each(function () {
                var obj = $(this);

                //variables
                var txtDefault = options.defaultText;                

                //focus blur section
                obj.each(function () {
                    this.value = txtDefault;
                });
                obj.focus(function () {
                    if (this.value == txtDefault) {
                        this.value = '';
                    }
                });
                obj.blur(function () {
                    if (this.value == '') {
                        this.value = txtDefault;
                    }
                });

            });
        }
    });
})(jQuery);


