-1
    var emails = document.getElementById('emails'),
     add_link = document.createElement('a'),
     template = emails.getElementsByTagName('div'),
     current = template.length,
     max = 20;
     template = template[0];

     submit1.onclick = function () {
     var new_field = template.cloneNode(true);
     current += 1;
     new_field.innerHTML = new_field.innerHTML.replace(/1/g, current);
     emails.appendChild(new_field);
    if (current === max) {
        add_link.onclick = null;
        document.body.removeChild(add_link);
    }
    return false;
    };

document.body.appendChild(add_link);

copy from this link add multiple textbox using button click in javascript

how to create button for remove ,please tell me

Community
  • 1
  • 1
Many_question
  • 95
  • 4
  • 13
  • https://www.google.nl/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#safe=off&q=remove%20element%20from%20dom – Jonathan Nov 16 '14 at 13:41

1 Answers1

0

Try using something like this.

elememt.parentNode.removeChild(element);

This question has been asked and posted on this site. Look at this link. Remove an Element with Javascript

Community
  • 1
  • 1
EglCode
  • 137
  • 1
  • 1
  • 8