Why this fails ...
$( 'div.contactAperson input' ).not( 'input.hadFocus' ).focus(function() { $(this).attr('value', '' ); });
... this meant sniffing out the input that didn't receive the .hadFocus class, and then when one of these subsets gets focus, it should replace the value with null.
Currently, input values ββalways get zapped - the .not test ('input.hadFocus') cannot stop execution.
Btw, preceding the above code, is the following code that works fine:
$( 'div.contactAperson input' ).focus(function() { $( this ).addClass( 'hadFocus' ); });
Thanks for any trick - greetings, -Alan
jquery-selectors
Alan
source share