How to mute audio using HTML5 ?
In this article, we mute the audio by using the muted attribute in the <audio> tag of the HTML document. It is used to define that the audio should be muted on the webpage.
Syntax:
<audio controls muted>
Example:
<!DOCTYPE html> < html > < head > < title > How to mute an audio using HTML5? </ title > </ head > < body > < h2 > GeeksForGeeks </ h2 > < h2 > How to mute an audio using HTML5? </ h2 > < p >Audio Sample</ p > < audio controls muted> < source src = "test.mp3" type = "audio/mp3" > < source src = "test.ogg" type = "audio/ogg" > </ audio > </ body > </ html > |
Output:
Supported browsers are listed below:
- Google Chrome 4.0
- Internet Explorer 9.0
- Firefox 3.5
- Opera 10.5
- Safari 4.0
Please Login to comment...