HTML onplay Attribute

❮ HTML Attributes

Example

<video onplay="myFunction()">



Standard Syntax

<element onplay="script">



Browser Support




Status




Applies to:

The onplay attribute can be used on the following element:

Element Attribute
<audio> play
<video> play






Attribute Values

Value Description
script Specifies a script that run when the media is play.
❮ HTML Attributes