YouTip LogoYouTip

Prop Audio Currenttime

HTML DOM Audio currentTime Property

HTML DOM Audio currentTime Property

-- Learning is not just about technology, but also about dreams!

JavaScript Reference

Overview

JavaScript Objects

Browser Objects

DOM Objects

HTML Objects

HTML DOM Area Object

HTML DOM Base Object

Audio currentTime Property

Audio Object Reference Audio Object

Example

Set the time position to 1 second:

document.getElementById("myAudio").currentTime = 1;

Try it yourself Β»


Definition and Usage

The currentTime property sets or returns the current playback position of the audio (in seconds).

When this property is set, playback jumps to the specified position.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The currentTime property is supported by all major browsers.

Note: Internet Explorer 8 or earlier does not support this property.


Syntax

Get the currentTime property:

audioObject.currentTime

Set the currentTime property:

audioObject.currentTime=seconds

Property Values

Value Description
seconds Indicates the current playback position of the audio (in seconds).

Technical Details

Return Value: A number representing the current playback time (in seconds).

Audio Object Reference Audio Object

HTML DOM Area Object

HTML DOM Base Object

iFlytek Xingchen Coding Plan includes free model call quotas, DeepSeek, GLM, Kimi, MiniMax, one-stop experience and deployment platform. Configuration Guide Β₯3.9/month Subscribe Now

Click to Share Notes

Cancel

← Prop Audio DefaultmutedProp Audio Currentsrc β†’