Saturday 11 February 2017

Auto hide placeholder text on focus on text field.

 it's so simple to remove placeholder text on focus on text field
        and get it back on blur if no text write inside text field.

        we use two function onfocus and onblur to do this.see below Example:


        <input type="text" placeholder="write text here" onfocus="this.placeholder = ''" onblur="this.placeholder = 'write text here'" />

        <a href="https://jsfiddle.net/mukesh89/qf2jwbmy/1/#" target="_blank"> Demo</a>

No comments:

Post a Comment