Default text in a textbox


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



Copy this code and paste it in your HTML
  1. <input type="text" value="Site search" onfocus="if (this.value=='Site search') {this.value = '';}" onblur="if(this.value=='') {this.value = 'Site search';}" name="search" />

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.