SyntaxFix
Write A Post
Hire A Developer
Questions
Try using a callback like this with the catch block.
document.getElementById("audio").play().catch(function() { // do something });