title: How do I fix "[ts] Property 'getAttribute' does not exist on type 'EventTarget'"
body: <p>I am trying to create an onClick event type to capture the target attribute in React while using TypeScript.  But I am getting the error "[ts] Property 'getAttribute' does not exist on type 'EventTarget'."  Can anyone help provide insight into best practice on how to fix this?</p>
  
  <p>I tried to use another helper function for the event.target part.  That way I can typeset this part, and the getAttribute part in this function.  However, I was told this is not best practice and wrong approach.</p>
  
  <pre><code>const Option = (props: OptionProps) =&gt; {
  
    const HandleOptionChange = (event: React.MouseEvent&lt;HTMLLIElement&gt;) =&gt; {
      return props.onOptionChange(event.target.getAttribute('value'));
    }
  
    return (
      &lt;li
        key={props.key}
        value={JSON.stringify(props.word)}
        onClick={HandleOptionChange}
      &gt;
        {props.word.value}
      &lt;/li&gt;
    )
  }
  </code></pre>
  
  <p>ts error message:</p>
  
  <p>[ts] Property 'getAttribute' does not exist on type 'EventTarget'.
  any</p>