MDN self-hosted library · e01.org

HTMLMediaElement: volumechange event

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const video = document.querySelector("video");

video.addEventListener("volumechange", (event) => {
  console.log("The volume changed.");
});
js
const video = document.querySelector("video");

video.onvolumechange = (event) => {
  console.log("The volume changed.");
};