Skip to content

Instantly share code, notes, and snippets.

@kreamweb
Created November 22, 2013 18:24
Show Gist options
  • Save kreamweb/7604568 to your computer and use it in GitHub Desktop.
Save kreamweb/7604568 to your computer and use it in GitHub Desktop.
Wordpress search form + Clear text Field
function clearText(field){
if (field.defaultValue == field.value) field.value = '';
else if (field.value == '') field.value = field.defaultValue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment