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

  • The onemptied attribute specifies though the present playlist is empty.
  • The onemptied attribute is a section of the Event Attributes.

Syntax for onemptied attribute in HTML:

<element onemptied="script">

Applies to:

Elements Attribute
<audio> onemptied
<video> onemptied

Sample coding for onemptied attribute in HTML:

<!DOCTYPE html>
        <title>Wikitechy onemptied attribute</title>
        <video width="320" height="240" controls onemptied="onEmptied()">
            <source src="hibiscus.mp4" type="video/mp4">
            function onEmptied() {
            alert("Wikitechy Video playlist is Empty!");

Code Explanation for onemptied attribute in HTML:

onemptied Attribute Code Explanation

  1. <video> tag is used to embed a video file in the HTML Document.
  2. The onemptied attribute is used to trigger an event when the playlist is empty.
  3. The JavaScript function onemptied is used to display an alert message.

Browser Support for onemptied attribute in HTML:

Yes Yes Yes Yes Yes

Related Searches to onemptied attribute in html