0

Here is the code,

        $(document).ready(function() {

        // CREATE A "DIV" ELEMENT AND DESIGN IT USING JQUERY ".css()" CLASS.
        var container = $(document.createElement('div')).css({
            padding: '5px', margin: '0'});

        $(container).append('<input type=text class="input" id="tb1" placeholder="Email" />');
        $(container).append('<input type=text class="input" id="tb2" placeholder="Email" />');
        $(container).append('<input type=text class="input" id="tb3" placeholder="Email" />');
        $(container).append('<input type=text class="input" id="tb4" placeholder="Email" />');
        $('#main').before(container);   // ADD THE DIV ELEMENTS TO THE "main" CONTAINER.

        var iCnt = 4;

        $('#btAdd').click(function() {
            if (iCnt <= 19) {

                iCnt = iCnt + 1;

                // ADD TEXTBOX.

                $(container).append('<input type=text class="input" id=tb' + iCnt + '  placeholder="Email" />');

                $('#main').before(container);   // ADD BOTH THE DIV ELEMENTS TO THE "main" CONTAINER.
            }
            else {      // AFTER REACHING THE SPECIFIED LIMIT, DISABLE THE "ADD" BUTTON. (20 IS THE LIMIT WE HAVE SET)

                $(container).append('<label>Reached the limit</label>'); 
                $('#btAdd').attr('class', 'bt-disable'); 
                $('#btAdd').attr('disabled', 'disabled');

            }
        });
}

I test in all the browsers, It works fine in IE10 and IE11, but in IE9 didn't placeholder name "email".

May i know, how to fix this, can anyone help me please?

Thanks in advance.

rish
  • 215
  • 1
  • 2
  • 15

1 Answers1

0

Unfortunately, IE9 does not support such attribute as placeholder. But you can avoid it, using jQuery. This link will help you: Placeholder in IE9

Community
  • 1
  • 1