title: How to add table rows from text fields
body: <p>I'm extremely new to jquery/html and want to make a diary that I can use to store my long distance running times in a table .</p>
  
  <p>This is my HTML code:</p>
  
  <p></p>
  
  <pre><code>&lt;head&gt;
  
  &lt;title&gt;Running Diary&lt;/title&gt;
  &lt;link type = "text/css" rel = "stylesheet" href= "running.css"/&gt;
  &lt;script language = "javascript" type = "text/javascript" src ="running.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  
  
  &lt;body&gt;
  &lt;!-- Title at the top of page !--&gt;
      &lt;h1 id = "title"&gt; Running Diary &lt;/h1&gt;
  &lt;/br&gt;
  &lt;/br&gt;
  &lt;/br&gt;
  &lt;!-- Table containing text/date fields and the entries for a running diary. !--&gt;
      &lt;table id = "diary"&gt;
  
  &lt;!-- Column titles for the running diary !--&gt;
          &lt;thead id = "diaryHeader"&gt;
              &lt;th&gt;Date&lt;/th&gt;
              &lt;th&gt;Distance Ran (KM)&lt;/th&gt;
              &lt;th&gt;Time&lt;/th&gt;
              &lt;/th&gt;
          &lt;/thead&gt;
  
  &lt;!-- The table row that contains the text field and enter button for adding each entry to the diary !--&gt;
          &lt;tbody&gt;
              &lt;tr id = "diaryFields"&gt;
                  &lt;td&gt; &lt;input type="date" id="dateField"/&gt;&lt;/td&gt;
                  &lt;td&gt; &lt;input type="text" id="distanceField" placeholder="Distance"/&gt; &lt;/td&gt;
                  &lt;td&gt; &lt;input type="text" id="timeField" placeholder="HH:MM:SS"/&gt; &lt;/td&gt;
                  &lt;td&gt; &lt;input type="submit" value="Add" id="diarySubmit"/&gt;
  
              &lt;/tr&gt;
  
  &lt;/table&gt;
  </code></pre>
  
  <p>I want the submit button to add a new table row onclick, with the values of the text/date fields as the new table row's data. what is the code to do that?</p>
  
  <p>I have no idea, this is all I have so far: </p>
  
  <pre><code>$(document).ready(function(){
  
  $(#"diarySubmit").onclick(function(){
  
      var distanceRan = document.getElementByName("distanceField").value;
      var timeRan = document.getElementByName("timeField").value;
      var dateRan = document.getElementByName("dateField").value;
  });
  });
  </code></pre>