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


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>
        <title>Wikitechy HTML onstalled Attribute</title>
        <h1>Wikitechy HTML onstalled Attribute</h1>
        <video width="300" height="300" controls onstalled ="onStalled()">
            <source src="Hibiscus.mp4" type="video/mp4">
            function onStalled() 
              alert ("The video is not available in Wikitechy");

Code Explanation for onstalled Attribute in HTML:

onstalled Attribute Code Explanation

  1. <video> tag is used to display the video.
  2. onstalled attribute is used to call onStalled() JavaScript function when the browser unable to get the video.
  3. function onStalled() is a JavaScript function.
  4. alert() method used to display an alert box.

Browser Support for onstalled Attribute in HTML:

Yes Yes Yes Yes Yes

Related Searches to onstalled Attribute in html