function CreateFormElement(remove){
var MyForm = document.getElementById('NewFields');
var input = remove ? MyForm.querySelector(':nth-last-child(1)') : document.createElement('input');
var br = remove ? MyForm.querySelector(':nth-last-child(2)') : document.createElement('br');
input.type = 'text';
input.name = 'MyField';
var ap = remove ? "removeChild" : "appendChild"
MyForm[ap](br);
MyForm[ap](input);
}
|