Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML onpause Attribute


Definition and Usage

The onpause attribute defines a script to be run when the audio/video is paused either by the user or programmatically.

Tip: The onplay attribute is used to define a script to run when the audio/video has been started or is no longer paused.


Applies to

The onpause attribute is part of the Event Attributes, and can be used on the following elements:

Elements Event
<audio> pause
<video> pause

Examples

Audio Example

Run "myFunction" if the audio is paused:

<audio onpause="myFunction()">
Try it Yourself »

Video Example

Run "myFunction" if the video is paused:

<video onpause="myFunction()">
Try it Yourself »

Browser Support

The onpause attribute has the following browser support for each element:

Element
audio Yes 9.0 Yes Yes Yes
video Yes 9.0 Yes Yes Yes