Skip to content

Instantly share code, notes, and snippets.

@dshaw002
Created April 11, 2013 16:26
Show Gist options
  • Save dshaw002/5364878 to your computer and use it in GitHub Desktop.
Save dshaw002/5364878 to your computer and use it in GitHub Desktop.
Changing text fields on focus / blur, etc.
<!--for HTML5 / modern browsers-->
<input name="name" placeholder="Enter Name" value="" />
<!--for newer browsers-->
<input name="name" value="Enter Name" onfocus="if(this.value=='Enter Name')this.value='';" onblur="if(this.value=='')this.value='Enter Name';" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment