Audio pause() method
Definition and usage
pause()
to pause the currently playing audio.
Tip:This method is usually used with play() method together.
Tip:Please use controls attribute Display audio controls (such as play, pause, search, volume, etc.).
Example
An audio player with play and pause buttons:
var x = document.getElementById("myAudio"); function playAudio() { x.play(); } function pauseAudio() { x.pause(); }
Syntax
audioObject.pause()
Parameters
None.
Return Value
No Return Value.
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | 9.0 | Support | Support | Support |