title: Cannot Play Audio in React Typescript with play() function | Error: Property 'play' does not exist
body: <p>I have created a simple Audio Player in React js with Typescript and I am trying to use the normal HTML5 functions to Play and Pause the Audio but it is not working.</p>
  
  <p>When I do <code>mytrack.play();</code> I  get this error: <code>Property 'play' does not exist on type 'HTMLElement'.</code> </p>
  
  <p>Here is my code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import React, { Component } from "react";
  import "./SimplePlayer.css";
  import styled from "styled-components";
  
  export interface SimplePlayerProps {}
  
  var mytrack = document.getElementById("mytrack");
  console.log(mytrack);
  mytrack.play();
  
  export class SimplePlayer extends Component&lt;SimplePlayerProps&gt; {
    constructor(props: SimplePlayerProps) {
      super(props);
      console.log(this.props);
      this.state = {};
    }
  
    render() {
      return (
        &lt;div id="wrapper"&gt;
          &lt;audio id="mytrack" controls&gt;
            &lt;source src="audio.mp3" /&gt;
          &lt;/audio&gt;
          &lt;nav&gt;
            &lt;div id="defaultBar"&gt;
              &lt;div id="progressBar" /&gt;
            &lt;/div&gt;
            &lt;div id="buttons"&gt;
              &lt;button type="button" id="playButton" /&gt;
              &lt;button type="button" id="muteButton" /&gt;
              &lt;span id="currentTime"&gt;0:00&lt;/span&gt;/
              &lt;span id="fullDuration"&gt;0:00&lt;/span&gt;
            &lt;/div&gt;
          &lt;/nav&gt;
        &lt;/div&gt;
      );
    }
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Any Help would be really appreciated :)
  Many Thanks</p>
  
  <p>Best Regards,
  Musayyab Naveed</p>