Wednesday, 25 May 2016

How to remove or add placeholder in dynamically created textboxes through using jquery.

In this article, I am going to show you how to remove or add placeholder in dynamically created html  input type textboxes. By using jquery you can easily add or remove placeholder text.

Below is the jquery code:-

 $(document).on({
        'focus': function () {
            // something
            $(this).attr('placeholder', '');
        },
        'blur': function () {
            // something
            $(this).attr('placeholder', 'Your placeholder text here');
        }
    }, 'input.myClass');


No comments:

Post a Comment