HTMLTableCellElement-cellIndex-attribute.html 765 B

12345678910111213141516171819202122
  1. <!DOCTYPE html>
  2. <script src="../include.js"></script>
  3. <script>
  4. test(() => {
  5. const testElements = ["td", "th"];
  6. for (const elementName of testElements) {
  7. // Test a <td> / <th> element with no parent.
  8. {
  9. const element = document.createElement(elementName);
  10. println(`lone ${elementName}.cellIndex = ${element.cellIndex}`);
  11. }
  12. // Test a <td> / <th> element with a parent <tr> element>.
  13. {
  14. const tr = document.createElement("tr");
  15. const element = tr.appendChild(document.createElement(elementName));
  16. println(`parented ${elementName}.cellIndex = ${element.cellIndex}`);
  17. }
  18. }
  19. });
  20. </script>