I want to play sound, after my page is loaded. Here is my javascript code:
var playAudio = $("#sound")[0];
playAudio.play();
and html code:
<audio id="sound">
<source src="../music/hide.ogg" type="audio/ogg">
<source src="../music/hide.mp3" type="audio/mp3">
</audio>
console: Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first.