<!DOCTYPE html> <html> <body> <audio id="myAudio" controls oncanplay="myFunction()"> <source src="https://download.samplelib.com/mp3/sample-3s.mp3" type="audio/ogg"> <source src="https://download.samplelib.com/mp3/sample-3s.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> <script> function myFunction() { alert("Can start playing the audio"); } </script> <p>This example demonstrates how to use the "oncanplay" attribute on a AUDIO element.</p> </body> </html>