Skip to content

Instantly share code, notes, and snippets.

@schalkburger
Created February 16, 2015 14:22
Show Gist options
  • Save schalkburger/3b3dd72f7529502699c7 to your computer and use it in GitHub Desktop.
Save schalkburger/3b3dd72f7529502699c7 to your computer and use it in GitHub Desktop.
Input placeholder text with JavaScript
<input type="text" value="email@example.com" name="Email" id="Email"
onblur="if (this.value == '') {this.value = 'email@example.com';}"
onfocus="if (this.value == 'email@example.com') {this.value = '';}" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment