Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Audio pause() Method

Audio pause() Method

Audio Object Reference Audio object

Example

An audio clip with play and pause buttons:

var x = document.getElementById("myAudio");

function playAudio()

{

     x.play();

}

function pauseAudio()

{

     x.pause();

}

Try it »


Definition and Usage

The pause() method stops (pauses) the currently playing audio or video.

Tip: This method is usually used together with play() the method.

**Tip:** Usecontrols attribute to display audio controls (such as play, pause, seeking, volume, etc. on the audio).


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the pause() method.

Note: Internet Explorer 8 or earlier browsers do not support this method.


Syntax

audioObject

.pause()

Parameters

None

Return Value

No return value

Audio Object Reference Audio object