Created
February 16, 2016 11:38
-
-
Save alaasalama/c5274a6c24771d518fed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery( document ).ready(function() { | |
jQuery('input[name=log]').val(''); | |
jQuery('input[name=pwd]').val(''); | |
jQuery('#log') | |
.on('blur', function(){ | |
var jQuerythis = jQuery(this); | |
if(jQuerythis.val() == 'Username'){ | |
jQuerythis.val(''); | |
} | |
}) | |
jQuery('#pwd') | |
.on('blur', function(){ | |
var jQuerythis = jQuery(this); | |
if(jQuerythis.val() == 'Password'){ | |
jQuerythis.val(''); | |
} | |
}) | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This JavaScript snippet to hide the value of text inputs based on their names, then emptying the onBlur and onFocus values based on the inputs IDs (these default values were "username/Password")