Advertisement
Home Open Editor ❯

HTML onplay Attribute

Example

<video onplay="myFunction()">

Try this code ❯


Standard Syntax

<element onplay="script">


Applies to:

The onplay attribute can be used on the following element:

Element Attribute
<audio> play
<video> play

Advertisement

Attribute Values

Value Description
script Specifies a script that run when the media is play.
Home Open Editor ❯
Advertisement