HTML onseeked Event Attribute

Description

The event attribute onseeked occurs when a user completes a move to a new audio / video playback position.

Syntax

<element onseeked="script">

Values

  • scriptThe name of the script to use when the event has been triggered.

Example

<!DOCTYPE HTML>
<html>
<body>

<p id="demo">Move the lever to a new audio position:</p>

<audio id="myAudio" controls onseeked="myFunction()">  
  <source src="audio.mp3" type="audio/mpeg">
  Your browser does not support the audio tag.
</audio>

<script>
function myFunction() {
    document.getElementById("demo").innerHTML = "You have moved to position " + document.getElementById("myAudio").currentTime;
}
</script> 

<p>This example shows how to use the onseeked attribute for an AUDIO element.</p>

</body>
</html>

Supported Tags

<audio> and <video>

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
XXYes3.5XX
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYes4XXX