By default place holder will stay there when we click on the text box, We can do it by writing simple code with javascript
as follows

<script type="text/javascript">
    $("input:text").each(function ()
        // store default value
        var v = $(this).attr('placeholder');
        $(this).focusin(function ()
        }).focusout(function ()

Don’t forget to include jQuery

The above code is mentioned only for text boxes we can add it for textarea also

Leave a Reply

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