Toggling Default Value of Textbox on Focus


When you click on the textbox, the dafault value disappears and when the focus loses, the default value appears in the text box.
 
<div><input type=”text” name=”firstname” id=”firstname” value=”eg. Siddharth Jain” onfocus=”if(this.value==’eg. Siddharth Jain’){this.value=”;}” onblur=”if(this.value==”){this.value=’eg. Siddharth Jain’;}” /></div>
Advertisements