Setting the innerHTML of a TBODY element, triggers a “Unknown run-time error”

  <script type="text/javascript">
  function emptyTable() {
    document.getElementById('theTable').innerHTML='    '
  }
  </script>

<table>
  <thead></thead>
  <tfoot></tfoot>
  <tbody id="theTable">
  </tbody>
</table>

It’s that simple.

If you need to empty a table TBODY, use

while (tbody.childNodes.length > 0) {
  tbody.removeChild(tbody.firstChild);
}