JAVALSCRIPTを表に行を追加します.


var j = 0;//         ID
td_length=3//    TR  3 TD
//    
function add() {

var ob = document.getElementsByTagName("tbody")[0];//  TBODY
var tr = document.createElement("tr");//    TR  

for (i = 0; i < td_length; i++) {

   td = document.createElement("td");//  TD  
  
   input = document.createElement("input");//    <input>  
   if(i<2){//        TD
  
   input.setAttribute("type", "text");//   input   
   input.setAttribute("value",j);//        
  
   }
   else//    TD
   {
   input.setAttribute("type","button");//   input   
  
  
// obj.addEventListener("click",functionA)//firefox  INPUT,         
//window.attachEvent("click",input,del());//ie  INPUT,         
  
  
   input.onclick=function(){//  INPUT,         
    del(this.parentNode.parentNode.id);//         ID
   }
    
  
   input.setAttribute("value","  ");//   
   }
   td.appendChild(input);//  
   tr.appendChild(td);//  
  
}
tr.setAttribute("id",j++);//  
ob.appendChild(tr);// TR  ID


}
//   
function del(v)//V TR ID
{
alert(v)
document.getElementById(v).style.display="none";//      
}