title: Adding buttons created in js to the table in html
body: <p>hello i have created buttons dynamically using js.now i need these buttons to be presented inside a table format with   in the html table tag help pls</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function funchr()
  {   
   $( ".hr" ).remove();
   
   var btn = document.createElement("BUTTON");      
      var t = document.createTextNode("VIEW PROFILE");      
      btn.appendChild(t);                                
      btn.setAttribute("id","viewid");
      btn.setAttribute("class","vp");
      document.body.appendChild(btn);
      
      var btn = document.createElement("BUTTON");        
      var t = document.createTextNode("EMPLOYEE DIRECTORY");       
      btn.appendChild(t);                               
      btn.setAttribute("id","empdir");
      btn.setAttribute("class","ed");
      document.body.appendChild(btn);
      
      var btn = document.createElement("BUTTON");        
      var t = document.createTextNode("CREATE ABSENCE");       
      btn.appendChild(t);                                
      btn.setAttribute("id","crabs");
      btn.setAttribute("class","ca");
      document.body.appendChild(btn);
    }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="hr"&gt;
  &lt;input type="button" id="hr" class="hrButton" value="HR" onclick="funchr();" /&gt;
  &lt;table id="hrtable"&gt; &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>