Question: This code works perfect for crome and firefox.. but error in IE8

```
if($('#soundcheck').is(':checked')){
                    //alert('checked');
                    var audio = document.createElement('audio');
                    document.body.appendChild(audio);
                    audio.src = system_base_url+'/sound/horn.wav';
                    audio.play();

                  }

```

IE8 says: Object doesn't support this property or method, and it points to :

```
audio.play();

```

Anyone having similar experience with IE8?

Regards

Answer: 
IE 8 and earlier does not support Audio tag, you need to use some hack.
Hope it can help.

```
<audio id='audio' controls>
      <source src="audioes/song.ogg" type="audio/ogg" />
      <source src="audioes/song.mp3" type="audio/mp3" />
      <div>Your browser doesn't support HTML5 audio</div>
      <%--Fall back on the WMP plugin--%>
      <object id='mediaPlayer' type="audio/mpeg" width="200" height="40"><param name="src" value="audioes/song.mp3" /></object>
</audio>

<script type="text/javascript">
function play () {
    var audio = document.getElementByID('audio');
    var mediaPlayer = document.getElementByID('mediaPlayer');
    //HTML5 Audio is Supported
    if(audio['play']) 
    {
    audio.play();
    }
    //HTML5 Audio is NOT Supported
    else
    {
    mediaPlayer.object.play();
    }
}
    </script>

```
Had the same problem! Try:

```
 <a href="javascript: void(0);" onclick="playSound('sound.mp3');">...</a>

<script language="javascript" type="text/javascript">
  function playSound(soundfile) {
  document.getElementById("dummy").innerHTML=
  "<embed src=\""+soundfile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";
  }
</script>

```