Name

Audio — an HTML <audio> element

Inherits from

Node, Element, MediaElement

Synopsis

An Audio object represents an HTML <audio> element. Except for its constructor, an Audio object has no properties, methods or event handlers other than those inherited from MediaElement.

Constructor

new Audio([string src])

This constructor creates a new <audio> element with a preload attribute set to “auto”. If the src argument is specified, it is used as the value of the src attribute.

Get JavaScript: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.