Mega Code Archive

 
Categories / JavaScript DHTML / Table
 

Create a Caption

<html> <body> <script language="JavaScript"> function function1() {     var myC = document.getElementById("myT").createCaption();     myC.innerText = "This is the new caption text"; }  </script> <table id="myT" border="3" cellpadding="5" style="border-color:blue">     <tr>         <th>This table has no caption</th>     </tr> </table> <input id="myT" type="button" value="Add caption" onclick="function1();"> </body> </html>