HTML onemptied Event Attribute
You are Here:
HTML onemptied Event Attribute
The onemptied
event attribute triggers when something bad happens and the media is suddenly unavailable.
Example
HTML Online Editor
<!DOCTYPE html>
<html>
<head>
<style>
video{
width: 100%;
height: 330px
}
</style>
</head>
<body>
<video id="myVid" onemptied="myFunction()" controls>
<source src="/hawk.mp4" type="video/mp4">
</video>
<button onclick="myEmptied()">Empty this video link</button>
<script>
function myFunction() {
alert("This video link is emptied");
}
function myEmptied(){
document.getElementById("myVid").src = "";
}
</script>
</body>
</html>
Attribute Value
Value | Explanation |
---|---|
script | Script runs when something bad happens and the file is suddenly unavailable. |
Reminder
Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in HTML.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.