CSS Portal
Run
Search
« Back to
HTML oncanplaythrough Event Attribute
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>oncanplaythrough event</title> </head> <body> <audio id="myAudio" controls oncanplaythrough="myFunction()"> <source src="audio.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> <script> function myFunction() { alert("EXAMPLE: Audio file ready to play without buffering"); } </script> <p>Demonstration of the "oncanplaythrough" attribute in the AUDIO element.</p> </body> </html>
If this site has been useful, we’d love your support! Running this site takes time and resources, and every small contribution helps us keep creating valuable content. Consider buying us a coffee to keep things going strong!
☕ Buy a Coffee