html tutorial - onwaiting Attribute in HTML - html5 - html code - html form

Learn html - html tutorial - Onwaiting attribute in html - html examples - html programs
- The onwaiting attribute specifies a script to run though the video stops because it wants to buffer the next frame.
- This event may also be used on <audio> elements, but it is frequently used for videos.
- The onwaiting attribute is a section of the Event Attributes.
Syntax for onwaiting attribute in HTML:
<element onwaiting="script">
Differences between HTML 4.01 & HTML5 for onwaiting attribute:
HTML 4.01
- HTML4 does not support <audio> and <video> tag.
HTML5
- HTML5 supports <audio> and <video> tag.
Applies to:
Elements | Attribute |
---|---|
<audio> | onwaiting |
<video> | onwaiting |
Attribute values:
Value | Description |
---|---|
Script | Script to be run on onwaiting |
Sample coding for onwaiting attribute in HTML:
Tryit<!DOCTYPE html>
<html>
<body>
<video width="320" height="240" controls onwaiting="onWaiting()">
<source src="hibiscus.mp4" type="video/mp4">
</video>
<script>
function onWaiting() {
alert ("Wait! Wikitechy video need to buffer the next frame");
}
</script>
</body>
</html>
Code Explanation for onwaiting attribute in HTML:

- <video> tag is used to defines that video controls should be visible.
- The onwaiting attribute specifies the video stops because it wants to buffer the next frame.
- <source> tag defines several video resources.
- src is an attribute, which describes the URL of the video file.
- function Wikitechy () is a JavaScript function (block of code), which is created to perform this alert method.
- alert () method shows an alert box with a parameter value and a particular message and an OK button.
Sample Output for onwaiting attribute in HTML:

- The video file has been displayed here.

- The output shows the running video with seconds.
- After changing the seconds in the video, the alert box has been displayed.
Browser Support for onwaiting attribute in HTML:
![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|
Yes | 9.0 | Yes | Yes | Yes |