title: TS(7015) in a document.form : "Element implicitly has an 'any' type because index expression is not of type "number"
body: <p>I am trying to get values entered by a user in a form.</p>
  <p>This is how my form looks like :</p>
  <pre><code>&lt;form name=&quot;myForm&quot;&gt;
     &lt;span class=&quot;myFormSpan&quot;&gt;+&lt;/span&gt;
     &lt;input type=&quot;text&quot; placeholder=&quot;My answer&quot; name=&quot;myFormUserInput&quot;&gt;
     &lt;button type=&quot;button&quot; class=&quot;formButton&quot;&gt;Ok&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  <p>I want to get what the user's put in the input form, so my typescript code looks like this :</p>
  <pre><code>formInputs.addEventListener(&quot;click&quot;, () =&gt; {
     const userInput: any = document.forms[&quot;myForm&quot;].elements[&quot;myFormUserInput&quot;].value;
     console.log(userInput);
  });
  
  </code></pre>
  <p>which works fine, except that I keep getting a TypeScript warning <code>ts(7015) : Element implicitly has an 'any' type because index expression is not of type 'number'.</code>. I've tried to change my code to <code>document.forms[0]</code>, which doesn't remove the warning, and tried to add some type specifications here and there without being more successful...</p>
  <p>I would like to keep implicit warning on (contrary to the solution written there: <a href="https://stackoverflow.com/questions/61818643/element-implicitly-has-an-any-type">Element implicitly has an &#39;any&#39; type</a>) because I would like to understand the issue and have a way to solve it</p>
  <p>Any idea ?</p>
  <p>Thanks a lot !</p>