Watermark Textbox

This is the simple way to make input text box as a watermark text box.
I have put onblur and onfocus event in textbox. See below example.

Search :  <input type="text" onFocus="if (this.value == 'Movies, Actor, Director'){this.value='';this.style.color='Black';this.style.fontStyle='normal';}"
onblur="if (this.value == '') {this.style.color='gray';this.value='Movies, Actor, Director';this.style.fontStyle='normal';} " value='Movies, Actor, Director' style="color:gray;font-style: normal; " />


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>