HTML audio Tag muted attribute Tutorial

In this section, we will learn what muted attribute is in HTML <audio> element.

What is muted attribute in HTML audio Tag?

When adding HTML <audio> element to a webpage, by default, the sound of the audio file is unmuted. This means if the audio file is autoplayed, it will automatically start to play with sounds on, and this could be annoying sometimes!

But we can add the `muted` attribute to HTML <audio> element and that sets the audio player to mute by default when the HTML document is loaded. So no sounds will be heard.

HTML muted Attribute in audio Tag Syntax:

<audio muted > </audio>

audio Tag muted Attribute Values

The `muted` attribute does not take any argument as its value and we only need to add this attribute to the opening tag of HTML <audio>.

Example: using muted attribute in HTML audio tag

See the Pen using muted attribute in HTML audio tag by Omid Dehghan (@odchan1) on CodePen.

Facebook
Twitter
Pinterest
LinkedIn

Top Technologies