html tutorial - onstalled Attribute in HTML - html5 - html code - html form
- The onstalled attribute specifies a script to run though the browser is trying to get media data, yet data is not available.
- The events that happens when there is some kind of disturbance to the media loading process, are:
- onerror
- onsuspend
- onabort
- onemptied
- The onstalled attribute is a section of the Event Attributes.
Syntax for onstalled attribute in HTML:
<element onstalled ="script">
Difference between HTML 4.01 and HTML 5 for onstalled Attribute:
HTML 4.01
HTML 5
Applies To:
Element | Attribute |
---|---|
<audio> | onstalled |
<video> | onstalled |
onstalled Attribute Values:
Value | Description |
---|---|
script | The script to be run on onstalled. |
Sample Coding for onstalled Attribute in HTML:
<!DOCTYPE html>
<html>
<head>
<title>Wikitechy HTML onstalled Attribute</title>
</head>
<body>
<h1>Wikitechy HTML onstalled Attribute</h1>
<video width="300" height="300" controls onstalled ="onStalled()">
<source src="Hibiscus.mp4" type="video/mp4">
</video>
<script>
function onStalled()
{
alert ("The video is not available in Wikitechy");
}
</script>
</body>
</html>
Code Explanation for onstalled Attribute in HTML:

- <video> tag is used to display the video.
- onstalled attribute is used to call onStalled() JavaScript function when the browser unable to get the video.
- function onStalled() is a JavaScript function.
- alert() method used to display an alert box.
Browser Support for onstalled Attribute in HTML:
![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes |