How to show/hide input value on focus


/ Published in: JavaScript

The simplest approach I know.


Copy this code and paste it in your HTML
  1. <input type="text" name="email" class="fmail" value="Email*" onblur="if(value=='') value = 'Email*'" onfocus="if(value=='Email*') value = ''" />

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.