Advertisement
trentjs

Child Count in Table Tr - total number of td in row

Nov 5th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. <table id="table00">
  3.     <tr id="trOne">
  4.       <td>Item A</td>
  5.       <td>Item B</td>
  6.       <td>Item C</td>
  7.     </tr>
  8. </table>
  9. */
  10.  
  11. doChildCount("trOne");
  12.  
  13. function doChildCount(strId){
  14.     var thisChildCount = document.getElementById(strId).childElementCount;
  15.     console.log(thisChildCount);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement