ja operation table, table,

 js add a row, delete a row

                                                    let str="<tr>"            
                                                              +"<td>"+a[1]+"</td>"
                                                              +"<td>"+p_money+"</td>"
                                                              +"<td>"+b_money+"</td>"                        
                                                              +"<td  ><span onclick=\"delTab('"+a[0]+"',this)\" style=\"color: blue;cursor:pointer;\">删除</span></td>"
                                                            +"</tr>";
                                                     $("#tab").append(str);
   function delTab(id,obj){
           ids=ids.replace(id+"#", "");
           var tr=obj.parentNode.parentNode;
           var tbody=tr.parentNode;
           tbody.removeChild(tr);
       }
    

 How many how many columns and rows to get data acquisition js

                  // Get the object table; 
                the let Tab = document.getElementById ( "Tab" );
                 // get all the number of rows in the table; 
                the let tablRows = tab.rows.length; 
                the let args = "" ;
                 for (I = the let. 1; I < tablRows; I ++ ) {
                       for (J = the let. 1; J <tab.rows [I]. 1-.cells.length; J ++ ) { 
                              args + = tab.rows [I] .Cells [J] + .innerText "#" ;                                             
                          } 
                          args + = "," ; 
                    }

 

Guess you like

Origin www.cnblogs.com/qq376324789/p/10928916.html