Easy Tutorial
❮ Prop Link Rel Prop Select Multiple ❯

onvolumechange Event

Event Object

Example

Execute JavaScript when the volume of the video changes:

More examples are included at the bottom of this page.


Definition and Usage

The onvolumechange event is triggered when the volume of a video/audio (audio/video) changes.

This event can be invoked by:

Tip: Use the volume property of the Audio or Video object to set or return the volume of the video/audio (audio/video).


Browser Support

The numbers in the table specify the first browser version that fully supports the event.

Event Chrome IE Firefox Safari Opera
onvolumechange Yes 9.0 Yes Yes Yes

Syntax

In HTML:

In JavaScript:

In JavaScript, using the addEventListener() method:

Note: The addEventListener() method is not supported in Internet Explorer 8 and earlier versions.


Bubbles: No
Cancelable: No
--- ---
Event Type: Event
--- ---
Supported HTML Tags: <audio>, <video>
--- ---

More Examples

Example

Execute JavaScript when the volume of the audio changes:

Example

Set the volume using the volume property:

❮ Prop Link Rel Prop Select Multiple ❯