title: Refresh a screen after a button is clicked
body: <p>I currently have several if statements that populate a specific table after the button refresh has been clicked. </p>
  
  <p>After the button is clicked again I need to remove the previous table that is polulated. How can I do that?</p>
  
  
  
  <pre><code>if (strDate == "Jan-2010") {
      var TableRowHtml = "&lt;table id='box-table-a'&gt;";
      TableRowHtml +="&lt;TR&gt;&lt;TH 'style='width: 50px'&gt;OPERATIONS&lt;/TH&gt;&lt;/TR&gt;";
      TableRowHtml +="&lt;TR&gt;&lt;TH 'style='width: 50px'&gt;Unit Costs&lt;/TH&gt;&lt;/TR&gt;";
      TableRowHtml +="&lt;TR&gt;&lt;TD&gt;" + Total[0] + "&lt;/TD&gt;&lt;/TR&gt;";
  }
  else if (strDate == "Feb-2010") {
      var TableRowHtml1 = "&lt;table id='box-table-a'&gt;";
      TableRowHtml1 +="&lt;TR&gt;&lt;TH 'style='width: 50px'&gt;OPERATIONS&lt;/TH&gt;&lt;/TR&gt;";
      TableRowHtml1 +="&lt;TR&gt;&lt;TH 'style='width: 50px'&gt;Unit Costs&lt;/TH&gt;&lt;/TR&gt;";
      TableRowHtml1 +="&lt;TR&gt;&lt;TD&gt;" + Total[1] + "&lt;/TD&gt;&lt;/TR&gt;"; 
  }
  else if (strDate == "Mar-2010") {
      var TableRowHtml2 = "&lt;table id='box-table-a'&gt;";
      TableRowHtml2 +="&lt;TR&gt;&lt;TH 'style='width: 50px'&gt;OPERATIONS&lt;/TH&gt;&lt;/TR&gt;";
      TableRowHtml2 +="&lt;TR&gt;&lt;TH 'style='width: 50px'&gt;Unit Costs&lt;/TH&gt;&lt;/TR&gt;";
      TableRowHtml2 +="&lt;TR&gt;&lt;TD&gt;" + Total[2] + "&lt;/TD&gt;&lt;/TR&gt;"; 
  }
  else if (strDate == "Apr-2010") {
      var TableRowHtml3  = "&lt;table id='box-table-a'&gt;";
      TableRowHtml3 +="&lt;TR&gt;&lt;TH 'style='width: 50px'&gt;OPERATIONS&lt;/TH&gt;&lt;/TR&gt;";
      TableRowHtml3 +="&lt;TR&gt;&lt;TH 'style='width: 50px'&gt;Unit Costs&lt;/TH&gt;&lt;/TR&gt;";
      TableRowHtml3 +="&lt;TR&gt;&lt;TD&gt;" + Total[3] + "&lt;/TD&gt;&lt;/TR&gt;"; 
  }
  </code></pre>
  
  <p>Dropdown code:</p>
  
  
  
  <pre><code>&lt;tr&gt;&lt;td&gt;&lt;select id="combobox"&gt;
        &lt;option value="Jan-2010"&gt;Jan/2010&lt;/option&gt;
        &lt;option value="Feb-2010"&gt;Feb/2010&lt;/option&gt;
        &lt;option value="Mar-2010"&gt;Mar/2010&lt;/option&gt;
        &lt;option value="Apr-2010"&gt;Apr/2010&lt;/option&gt;
        &lt;option value="May-2010"&gt;May/2010&lt;/option&gt;
        &lt;option value="Jun-2010"&gt;Jun/2010&lt;/option&gt;
    &lt;/select&gt;&lt;/td&gt;
    &lt;td&gt;&lt;input type="button" id="RefreshMetrics"  value="Refresh"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/select&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="button" id="RefreshMetrics"  value="Refresh"&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>/////////////////////////////////////////////////////////////////////////////</p>
  
  <p>Can place the below code in each specfic if statement e.g... remove each table that is not needed ... for that paticular month</p>
  
  <pre><code>                      if (strDate == "Jan-2010") 
  
                      {
  
  
                     $('TableRowHtml1').last().remove();
                     $('TableRowHtml2').last().remove();
                     $('TableRowHtml3').last().remove();
  
  
  
         var TableRowHtml = "&lt;table id='box-table-a'&gt;";     
         TableRowHtml +="&lt;TR&gt;&lt;TH 'style='width: 50px'&gt;OPERATIONS&lt;/TH&gt;&lt;/TR&gt;";           
   TableRowHtml +="&lt;TR&gt;&lt;TH 'style='width: 50px'&gt;Unit Costs&lt;/TH&gt;&lt;/TR&gt;";                   TableRowHtml +="&lt;TR&gt;&lt;TD&gt;" + Total[0] + "&lt;/TD&gt;&lt;/TR&gt;";     
                  }           
  </code></pre>