title: TS2339: Property 'style' does not exist on type 'Element'
body: <p>Here's the code:</p>
  
  <pre><code>const test = Array.from(document.getElementsByClassName('mat-form-field-infix'));
  test.forEach((element) =&gt; {
      element.outerHTML = '&lt;div class="good-day-today" style="width: 0px;"&gt;&lt;/div&gt;'; // Please note that this line works fine!
      element.style.padding = '10px';
      element.style.borderTop = '0';
  });
  </code></pre>
  
  <p>Error I get when compiled:</p>
  
  <blockquote>
    <p>ERROR in src/app/<strong><em>/</em></strong>.component.ts(101,21): error TS2339: Property
    'style' does not exist on type 'Element'.
    src/app/<strong><em>/</em></strong>.component.ts(102,21): error TS2339: Property 'style'
    does not exist on type 'Element'.</p>
  </blockquote>
  
  <p>How can I fix it?</p>
  
  <p>I tried to remove the <code>Array.from...</code> part, tried to use <code>for of</code> and <code>for in</code>, tried <code>as any</code>, but above is the way I have to do it.</p>