问答详情
源自:9-22 编程练习

拜托大家看看有啥问题

       function addOne(){
            alert()
             var one=document.createElement("tr");
             table.appendChild(one);
             for(i=0;i<3;i++){
                 var td=document.createElement("td");
                 if(i!=2){  
                 td.innerHTML="果子";
             
                 
                 }else{
               
                     var de=document.createElement("a");
                     de.href="javascript:;";
                     de.onclick="deleteOne()";
                     td.appendChild(de);
                     td.innerHTML="删除";
                 }
                 
                 one.appendChild(td); 
              
             }
         }


提问者:果子李 2015-07-30 20:46

个回答

  • 果子李
    2015-07-31 10:33:14

     td.innerHTML = "<a href='javascript:;' onclick='deleteRow(this)'>删除</a>";innerHTML的新理解