This table is element x
.
th in thead | td in thead | td in thead |
---|---|---|
th in tfoot | td in tfoot | td in tfoot |
th in tbody | td in tbody | td in tbody |
td in tbody | td in tbody | td in tbody |
td in tbody | td in tbody | td in tbody |
This page tests a few basic HTML DOM properties.
This function is called by every test script on the page:
function showMsg(obj) { var insertIn = obj.getElementsByTagName('td')[0] || obj; insertIn.innerHTML = 'Access to ' + obj.nodeName + ' granted'; }
var y = x.caption; showMsg(y);
var y = x.rows[1]; showMsg(y);
var y = x.rows[0].cells[0]; showMsg(y);
var y = x.tBodies[0]; showMsg(y);
var y = x.tFoot; showMsg(y);
var y = x.tHead; showMsg(y);
var y = x.caption; y.innerHTML = 'innerHTML works';
var y = x.rows[1]; y.innerHTML = '<td>innerHTML works</td>';
var y = x.rows[0].cells[0]; y.innerHTML = 'innerHTML works';
var y = x.tBodies[0]; y.innerHTML = '<tr><td>innerHTML works</td></tr>';
var y = x.tFoot; y.innerHTML = '<tr><td>innerHTML works</td></tr>';
var y = x.tHead; y.innerHTML = '<tr><td>innerHTML works</td></tr>';