"FOCUSIN" and "FOCUSOUT" functions, doesn't work in the developing plugin

"FOCUSIN" and "FOCUSOUT" functions, doesn't work in the developing plugin

hello,

i created a plugin to erase the value in the input text or password with the focus in, and insert the default value with the focus out, if there is not value in the input.

it doesn't work into focusin and focusout functions, why ?
thank for help.

here is the code :

  1. (function($) {
        $.fn.focusInputValue = function() {
            var $$ = $(this);
            var selector = $('input:text, input:password, textarea');
           
            $$.focusin( function() {
                alert('IN');
                $(this).attr('value', '');
            });
           
            $$.focusout( function() {
                alert('OUT');
                if( $(this).attr('value') == '') {
                    $(this).attr( 'value', '');
                }
            });
               
            return $(this);
        };
    }) (jQuery);


















  2.  
  3. // Use the plugin
  4. $('input:text, input:password, textarea').focusInputValue();