global focus() focusout() with clearing and restoring input value's
Trying to create a method/function how ever you want to call it, that will allow me to clear input values on inputs with focus() and restore the input values if nothing is entered or keep what the user types on focusou().
Below is what I have so far. Thanks for feedback and help.
- $('input.address-input').click(function(){
- elan = $(this).val();
- $('input.address-input').focus(function(){
- if($('input.address-input').val() == elan){
- $(this).val('');
- }
- })
- $('input.address-input').focusout(function(){
- return false;
- if($(elan).val() == ''){
- $(this).val() = elan;
- }
- })
- })