HTML Audio/Video DOM volume Property
HTML Audio/Video DOM Reference
Example
Set the video volume to 20%:
myVid=document.getElementById("video1");
myVid.volume=0.2;
Try it »
Definition and Usage
The volume property sets or returns the current volume of the audio/video.
Browser support





All major browsers support the volume attribute.
**Note:** Internet Explorer 8 and earlier versions do not support this property.
Syntax
Set the volume attribute:
audio|video
.volume=
volumevalue
Return the volume attribute:
audio|video
.volume
Attribute values
| Value | Description |
|---|---|
| volumevalue | Specifies the current volume of the audio/video. Must be a number between 0.0 and 1.0. |
例值:
Technical Details
| Return Value: | A numeric value indicating the current volume. |
|---|---|
| Default value: | 1.0 |
HTML Audio/Video DOM Reference