'tBodies' Example : tBodies : Javascript Collections JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Javascript Collections » tBodies »

 

'tBodies' Example



    
<html>
<body>
<table id="myTable" width="16%" border="1">
    <tbody>
        <tr><td>Row 1</td></tr>
        <tr><td>Row 2</td></tr>
        <tr><td>Row 3</td></tr>
    </tbody>
    <tbody>
        <tr><td>Row 4</td></tr>
        <tr><td>Row 5</td></tr>
        <tr><td>Row 6</td></tr>
    </tbody>
</table>
<button onclick="function1;">Get total number of tbody elements</button>
<script language="JavaScript">
    function function1 {
        var m = document.getElementById("myTable").tBodies.length; 
        alert(m)
    }
</script>
</body>
</html>

    
      
      



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Javascript Collections
» tBodies