English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The controls attribute is a boolean attribute; if the attribute is present, it specifies how the audio controls are displayed; audio controls include: play, pause, progress bar, volume
An <audio> element with browser default controls:
<!DOCTYPE html> <html> <title>HTML:<audio> controls attribute - 基础教程网 oldtoolbag.com</title> <body> <audio controls> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> </body> </html>Test it out ‹/›
IEFirefoxOperaChromeSafari
Internet Explorer 9+, Firefox, Opera, Chrome, and Safari browsers support the controls attribute.
Note: Internet Explorer 8 and earlier IE versions do not support the <audio> tag.
The controls attribute is a boolean attribute.
If the attribute exists, it specifies how the audio control is displayed.Audio/Video controls include:
Play
Pause
Progress bar
Volume
<audio> element is HTML5Newly added.
In XHTML, this attribute is not allowed to be abbreviated, the controls attribute must be defined as <audio controls="controls">.
<audio controls>