Following is the syntax - Home >Web Front-end >HTML Tutorial >Execute script in HTML when browser cannot get media data for any reason? Use the onstalled attribute in HTML to execute the script when the browser cannot get the media date. The - - onstalled Properties- The above is the detailed content of Execute script in HTML when browser cannot get media data for any reason?. For more information, please follow other related articles on the PHP Chinese website!Execute script in HTML when browser cannot get media data for any reason?
<video>
<audio>
The following is the syntax for <!DOCTYPE HTML>
<html>
<body>
<video width = "300" height = "200" controls onstalled ="display()">
<source src = "/html5/foo.ogg" type = "video/ogg" />
<source src = "/html5/foo.mp4" type = "video/mp4" />
Your browser does not support the video element.
</video>
<script>
function display()
{
alert ("Sorry! Video isn't available right now!");
}
</script>
</body>
</html>
Related articles
See more