title: Adding new row to table using javascript
body: <p>I have searched and found similar answers to this but not exactly and I can't figure out what I'm doing wrong... Thanks for any help you can provide!</p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;
  &lt;script&gt;
  function doTheInsert() {
    var newRow=document.getElementById('myTable').insertRow();
    newRow="&lt;td&gt;New row text&lt;/td&gt;&lt;td&gt;New row 2nd cell&lt;/td&gt;";
  }
  &lt;/script&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;table id="myTable" border="1"&gt;
    &lt;tr&gt;
      &lt;td&gt;First row&lt;/td&gt;
      &lt;td&gt;First row 2nd cell&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Second row&lt;/td&gt;
      &lt;td&gt;more stuff&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  &lt;br&gt;
  &lt;input type="button" onclick="doTheInsert()" value="Insert new row"&gt; 
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>