TextTrackCue.onenter

The onenter EventHandler of the TextTrackCue interface processes the enter event.

The enter event fires when a cue becomes active. In the case of subtitles or a caption this is when it displays over the media.

Syntax

TextTrackCue.onenter = function;
TextTrackCue.addEventListener('enter', function);

Example

In the following example, onenter is used to print to the console when cue1 is the active cue.

cue1.onenter = function() {
  console.log('Cue 1 has displayed');
}

Specifications

Specification
HTML Standard (HTML)
# handler-texttrackcue-onenter

Browser compatibility

BCD tables only load in the browser