B2G/gecko/dom/tests/js/tables/changeCell.js
// Given a table element, find the first table body
Given a table element, find the first table body
Given a table element find the first table body
function findTableBody(table)
{
  var children = table.childNodes
  if (children == null) {
    return null;
  }
  var length = children.length;
  var child = null;
  var count = 0;
  while (count < length) {
    child = children[count];
    if (child.nodeType == Node.ELEMENT_NODE) {
      if (child.tagName == "TBODY") {
        break;
      }
    }
    count++;
  }
  return child;
}
function findTableBody ( table ) { var children = table . childNodes if ( children == null ) { return null ; } var length = children . length ; var child = null ; var count = 0 ; while ( count < length ) { child = children [ count ] ; if ( child . nodeType == Node . ELEMENT_NODE ) { if ( child . tagName == "TBODY" ) { break ; } } count ++ ; } return child ; }
Given a table element, find the first table body
Given a table element find the first table body
// XXX A better way to do this would be to use getElementsByTagName(), but // it isn't implemented yet...