Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var inputs = {};
- jQuery('.gfield input, .gfield textarea' ).each( function(){
- var _id = jQuery( this ).attr('id');
- var _string = jQuery( this ).val();
- inputs[_id] = _string;
- });
- jQuery('.gfield input, .gfield textarea').click(function(){
- var _id = jQuery( this ).attr('id');
- var value = jQuery( this ).val();
- if( value == inputs[ _id ] ){
- jQuery( this ).val('');
- }
- });
- jQuery( '.gfield input, gfield textarea').blur( function(){
- var _id = jQuery( this ).attr('id');
- var value = jQuery( this ).val();
- if( value == '' ){
- jQuery( this ).val( inputs[ _id ] );
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement