Table Row Counter

HTML

<button id="rowCount">Count 'Em</button>
<input type="text" id="Mytextbox">
<br />
<table id="myTable">
  <thead>
    <tr></tr>
    <tr></tr>
    <tr></tr>
  </thead>
  <tbody>
    <tr></tr>
    <tr>
      <table>
        <tbdoy>
          <tr></tr>
        </tbdoy>
      </table>
    </tr>
  </tbody>
</table>
<p id="test"></p>

JavaScript

$(function () {
    $('#rowCount')
        .button()
        .click(function () {
        $('#test').html("Rows = " + ($('table#myTable tr:last').index() + 1));
    })
});

function add(text){
    var TheTextBox = document.getElementById("Mytextbox");
    TheTextBox.value = TheTextBox.value + text;
}