title: Typescript error Property does not exist on type 'HTMLElement'. any
body: <p>I am trying to create a table using javascript inside typescript but I am getting error:</p>
  
  <pre><code>[ts] Property 'insertRow' does not exist on type 'HTMLInputElement'.
  any
  </code></pre>
  
  <p>My code which is generating a table is like this:</p>
  
  <pre><code>  createTable(chart){
    var table = document.createElement("TABLE");    
    var row,header,cell1, cell2;
    var data = chart.options.data;
  
    table.style.border = "1px solid #000"; 
    header = table.createTHead();
    row = header.insertRow(0);    
    cell1 = row.insertCell(0);
    cell2 = row.insertCell(1);
    cell1.style.border = "1px solid #000"; 
    cell2.style.border = "1px solid #000"; 
    cell1.innerHTML = "&lt;b&gt;X-Value&lt;/b&gt;"; 
    cell2.innerHTML = "&lt;b&gt;Y-Value&lt;/b&gt;"; 
  
    for(var i = 0; i &lt; data.length; i++){
      for(var j = 0; j&lt; data[i].dataPoints.length; j++){
        row = table.insertRow(1);
  
        cell1 = row.insertCell(0);
        cell2 = row.insertCell(1);
        cell1.style.border = "1px solid #000"; 
        cell2.style.border = "1px solid #000"; 
  
        cell1.innerHTML = data[i].dataPoints[j].x;
        cell2.innerHTML = data[i].dataPoints[j].y; 
      }
    }    
    document.getElementById("chartContainer").appendChild(table);
  }
  </code></pre>
  
  <p>I am getting errors for two properties createTHead() and insertRow()  I followed few answers in stackoverflow I used this:</p>
  
  <pre><code>(document.createElement("TABLE")) as HTMLInputElement;
  
  (table.createTHead()) as HTMLBodyElement;
  (table.createTHead()) as HTMLInputElement;
  </code></pre>
  
  <p>I tried these following things I don't know why I am getting this error:</p>