Return to Snippet

Revision: 51899
at October 7, 2011 00:14 by dhjapan


Initial Code
$(document).ready(function(){
		 
			// Form : login
			$("input[name=login]")
				.blur( function() { if ($(this).val() == '' || $(this).val() == 'login') $(this).css('color', '#999').val('login'); } )
				.focus( function() { if ($(this).val() == 'login') $(this).css('color', '#fff').val(''); } )
				.trigger('blur')
			;
			// Form : password
			$("input[name=pass]")
				.blur( function() { if ($(this).val() == '' || $(this).val() == 'password') $(this).css('color', '#999').val('password'); } )
				.focus( function() { if ($(this).val() == 'password') $(this).css('color', '#fff').val(''); } )
				.trigger('blur')
			;
			
		} );

Initial URL

                                

Initial Description

                                

Initial Title
JQuery, login/password fields

Initial Tags
login, jquery

Initial Language
JavaScript