Toggling Default Value of Textbox on Focus


When you click on the textbox, it becomes blank but as the focus loses, the default value again appends to the text box.
It’s very simle
Just copy and paste this code on your page:

<div class="signin_right" ><input type="text" name="emailid" id="emailid" style="color:#8B8B8B" value="Your Official Email Id" onfocus="if(this.value == 'Your Official Email Id'){this.value=''; this.style.color='#000000';}" onblur="if(this.value==''){ this.value='Your Official Email Id'; this.style.color='#8B8B8B';}"/></div>

Comments

Post a Comment