HTMLTrackElement: cuechange event

The cuechange event fires when a TextTrack has changed the currently displaying cues. The event is fired on both the TextTrack and the HTMLTrackElement in which it's being presented, if any.


Use the event name in methods like addEventListener(), or set an event handler property.

addEventListener("cuechange", (event) => {});

oncuechange = (event) => {};

Event type

A generic Event with no added properties.


The underlying TextTrack, indicated by the track property, receives a cuechange event every time the currently-presented cue is changed. This happens even if the track isn't associated with a media element.

If the track is associated with a media element, using the <track> element as a child of the <audio> or <video> element, the cuechange event is also sent to the HTMLTrackElement.

let textTrackElem = document.getElementById("texttrack");

textTrackElem.addEventListener("cuechange", (event) => {
  let cues =;

Alternatively, you can use the oncuechange event handler:

let textTrackElem = document.getElementById("texttrack");

textTrackElem.oncuechange = (event) => {
  let cues =;


HTML Standard
# event-media-cuechange
HTML Standard
# handler-oncuechange

Browser compatibility

BCD tables only load in the browser

See also