HTML Audio/Video DOM mediagroup Property

❮ HTML Audio/Video DOM Reference

Example

var vid = document.getElementById("myVideo");

function setMedGroup() {
  vid.mediaGroup="demo";
}

function changeMedGroup() {
  vid.mediaGroup="demo2";
}

function getMedGroup() {
  alert("Video media group: " + vid.mediaGroup);
}

Meaning

The mediagroup property sets or returns the group the audio/video belongs to link multiple audio/video elements.

Return a string value. Specifing the media group of the audio/video.


Standard Syntax

Return the mediagroup property:

audio|video.mediagroup

Set the mediagroup property:

audio|video.mediagroup="string"



Browser Support




Status







Return Value

Type Description
string Specifies the media group of the audio/video.
❮ HTML Audio/Video DOM Reference