Javascript examples for DOM HTML Element:ColumnGroup
ColumnGroup span Property - Return the number of columns a <colgroup> element should span:
<!DOCTYPE html> <html> <head> <style> table, th, td { border:1px solid black; } </style>/*from w w w .j a v a 2 s .c o m*/ </head> <body> <table> <colgroup id="myColgroup"></colgroup> <tr> <th>ISBN</th> <th>Title</th> <th>Price</th> </tr> <tr> <td>001</td> <td>HTML</td> <td>$5</td> </tr> <tr> <td>002</td> <td>CSS</td> <td>$5</td> </tr> </table> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { var v = document.getElementById("myColgroup").span; document.getElementById("demo").innerHTML = v; } </script> </body> </html>