Javascript HTML5 change icon for fa-play
<p>I added a audio(autoplay) on my website.
Actually I want to pause and play the music, 
the icon should also toggle at the same time to <code>fa-play</code>.</p>

<p>This is my HTML markup:</p>

<pre class="lang-js prettyprint-override"><code>&lt;script type="text/javascript"&gt;
    function toggleSound() {
        var audioElem = document.getElementById('player');
        if (audioElem.paused)
            audioElem.play();
        else
            audioElem.pause();
    }

&lt;/script&gt;
</code></pre>

<pre class="lang-html prettyprint-override"><code>&lt;li&gt;
    &lt;a class="fa fa-pause" id="player" type="button"
  onclick="javascript:toggleSound();"&gt;
        &lt;span&gt;Play/Pause&lt;/span&gt;
    &lt;/a&gt;
&lt;/li&gt;
</code></pre>

<pre class="lang-html prettyprint-override"><code>&lt;audio autoplay id="player" src="embrace.mp3"&gt;&lt;/audio&gt; 
</code></pre>