Audio autoplayProperty
Examples
Check whether the audio is set to play immediately after loading:
Try it Yourself »
Definition and Usage
The autoplay property sets or returns whether the audio/video starts playing immediately after loading.
This property reflects the <audio> autoplay attribute.
If the autoplay attribute is set, it specifies that the audio will start playing immediately after loading.
Note:The <audio> element is a new element in HTML5.
Browser Support
![]()
![]()
![]()
![]()
![]()
The autoplay property is supported by all mainstream browsers.
Note:Internet Explorer 8 and earlier IE versions do not support the <video> element.
Syntax
Return the autoplay property:
Set the autoplay property:
Property Values
| Value | Description |
|---|---|
| true|false | Sets whether the audio/video starts playing immediately after loading.
|
Technical Details
| Return Value: | A Boolean value. Returns true if the audio autoplay is set, otherwise returns false. |
|---|---|
| Default Value: | false |
More Examples
Examples
Enable autoplay, and reload the video:
x.autoplay = true;
x.load();
Try it Yourself »
Examples
The following example demonstrates how to create a <video> element and set the autoplay attribute:
Try it Yourself »
Related Pages
HTML Reference Manual:HTML <audio> autoplay attribute
Other Extensions
Audio Object