How to show/hide input value on focus


/ Published in: JavaScript
Save to your folder(s)

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


You need to login to view comments.