Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <style> table, th { border: 1px solid black; } </style> </head> <body> <p>Click the button to change the value of the headers attribute of th with id "myTh".</p> <table id="myTable"> <tr> <th id="name" colspan="3">Name</th> </tr> <tr> <th id="myTh" headers="fname">First name</th> <th headers="mname">Middle name</th> <th headers="lname">Last name</th> </tr> </table> <br> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myTh").headers = "newValue"; document.getElementById("demo").innerHTML = "The value of the headers attribute was changed from 'name' to 'newValue'."; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_th_headers3 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:35:12 GMT --> </html>
Result:
Try it Yourself - © w3schools.com