document.getElementById("提交"). onclick=function(){ //alert("成功"); //取得輸入節點 var nameElement=document.getElementById("iname"); var emailElement=document.getElementById("iname"); var emailElement=document.getElementById ("iemail"); varaddresssElement=document.getElementById("iaddress");
//建立表格節點 var trNode=document.createElement("tr"); var nameNode=document.createElement("td"); var emailNode=document.createElement("td"); var addressNode=document.createElement("td");
//向表格中新增建立的節點及文字內容 var borderElement=document.getElementById("border"); borderElement.appendChild(trNode); trNode.appendChild(nameNode); trNode.appendChildldtrNode.append (emailNode); trNode.appendChild(addressNode); var nametextNode=document.createTextNode(nameElement.value); var emailtextNode=document.createTextNodeNode(email.value) document.createTextNode(addresssElement.value); nameNode.appendChild(nametextNode); emailNode.appendChild(emailtextNode); addressNode.appendChild(addresstext| /腳本>