Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<p>This example demonstrates how to assign an "onpause" event to an audio element.</p>
<p>Play and pause the video.</p>
<audio controls onpause="myFunction()">
  <source src="horse.ogg" type="audio/ogg">
  <source src="horse.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>
<script>
function myFunction() {
  alert("The audio was paused");
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onpause_audio by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 21 Dec 2022 17:40:01 GMT -->
</html>