Posted By

frederick on 07/10/10


Tagged


Versions (?)

input-focus


 / Published in: JavaScript
 

  1. //<input id="form_email" name="form_email" value="enter email here" type="text" onfocus="clearText(this)" onblur="shownewsletter(this)" />
  2.  
  3. function clearText(thefield){
  4. if (thefield.defaultValue==thefield.value)
  5. thefield.value = ""
  6. }
  7.  
  8. function shownewsletter(thefield){
  9. if (thefield.value=="")
  10. thefield.value = "Search site here"
  11. }
  12.  

Report this snippet  

You need to login to post a comment.