//建立節點 var addItems = function() { document.getElementById("div1").innerHTML = ""; var value = parseInt(document.getElementById('itemsNumber').value); for (var i = 0; i var input = document.createElement("input"); input.setAttribute("類型", "文字"); var br = document.createElement ("br"); document.getElementById("div1").appendChild(input); document.getElementById("div1").appendChild(br);