Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Execute a script when the file is unavailable in HTML?
Use the onemptied attribute in HTML to execute a script when the file is unavailable in HTML or it is empty.
Example
You can try to run the following code to implement the onemptied attribute −
<!DOCTYPE HTML>
<html>
<body>
<video width = "300" height = "200" controls onemptied ="display()">
<source src = "/html5/foo.ogg" type = "video/ogg" />
Your browser does not support the video element.
</video>
<script>
function display()
{
alert ("Sorry! Empty playlist!");
}
</script>
</body>
</html>Advertisements