Horje

Exanple of HTML onplay Event Attribute

It will alert that the video has started to play.
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>
<script>
function myFunction() { alert('The video has started to play');
}
</script>
<p>Press play on the video:</p>
<video controls onplay="myFunction()"> <source src="https://download.samplelib.com/mp4/sample-5s.mp4" type="video/mp4"> <source src="https://download.samplelib.com/mp4/sample-5s.mp4" type="video/ogg"> Your browser does not support HTML5 video.
</video>
<p>Video courtesy of <a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p>
</body>
</html>

Output should be:

Exanple of HTML onplay Event Attribute



Single Articles
Exanple of HTML onplay Event Attribute HTML Media Events Attribute


Related Articles
List of Media Events HTML Media Events Attribute
HTML onabort Event Attrribute HTML Media Events Attribute
HTML oncanplay Event Attribute HTML Media Events Attribute
HTML oncanplaythrough Event Attribute HTML Media Events Attribute
HTML ondurationchange Event Attribute HTML Media Events Attribute
HTML onended Event Attribute HTML Media Events Attribute
HTML onerror Event Attribute HTML Media Events Attribute
HTML onloadeddata Event Attribute HTML Media Events Attribute
HTML onloadedmetadata Event Attribute HTML Media Events Attribute
HTML onloadstart Event Attribute HTML Media Events Attribute
HTML onpause Event Attribute HTML Media Events Attribute
HTML onplay Event Attribute HTML Media Events Attribute

Type :
html
Category :
Web Tutorial
Sub Category :
HTML Media Events Attribute
Uploaded by :
Admin