HTML onpause Attribute
The HTML onpause Attribute is a event attribute which when the Audio has been paused by the user or it will be automatically paused or stop.
Usage: This attribute is used in <audio> and <video> Tags.
Attribute Value: This attribute contains single value script which works when onpaused event attribute call. This attribute is supported by <audio> and <video> tags.
Syntax:
<element onpause="myScript">
Example:
html
<!DOCTYPE html> < html > < head > < title > HTML onpause Attribute </ title > </ head > < body > < center > < h1 > w3wiki </ h1 > < h1 style = "color:green" > HTML onpause Attribute </ h1 > < video controls id = "Beginner" > < source src = "Geekfun.mp4" type = "video/mp4" > </ video > < script > var aud = document.getElementById("Beginner"); aud.onpause = function() { alert("video is paused now"); }; </ script > </ body > </ html > |
Output:
Supported Browsers:
- Google Chrome
- firefox
- Safari
- Opera
- Internet Explorer
Contact Us