Created
September 2, 2013 08:12
-
-
Save kiennt2/6410384 to your computer and use it in GitHub Desktop.
input clearText : onblur - onfocus
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
function clearText(field){ | |
if (field.defaultValue == field.value) field.value = ''; | |
else if (field.value == '') field.value = field.defaultValue; | |
//<input type="text" onblur="clearText(this)" onfocus="clearText(this)" value="value"/> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment