Audio play() Method
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 play() method starts playing the current audio.
**Tip:** This method is usually used together with pause() the method.
Tip: Usecontrols attribute to display audio controls (such as play, pause, seeking, volume, etc. on the audio).
Browser support





All major browsers support the play() method.
Note: Internet Explorer 8 or earlier browsers do not support this method.
Syntax
audioObject
.play()
Parameters
| None |
|---|
Return Value
| No return value |
|---|
Audio object