var div = document.createElement("div"); div.innerHTML = '<input type="password" maxlength="20" name="signup_password" value="" class="input_text"/>'; var input = div.removeChild(div.firstChild); div = null; form.appendChild(input); input = null;