I am trying to play a sound on event using javascript
tried this
<object height="100" width="100" data="sounds/cash.wav" id="cash"></object>
var thissound= document.getElementById("cash");
thissound.play();
and it worked. the thing is , I don't my element to show on the browser, so I tried
<object height="0" width="0" data="sounds/cash.wav" id="cash"></object>
and even
<object height="100" width="100" data="sounds/cash.wav" id="cash" style="display:none"></object>
and I got an error in the JS telling me that the element is null..