HTML | DOM Audio defaultMuted Property
The Audio defaultMuted property is used for setting or returning whether the audio should be muted by default or not.
The audio defaultMuted property cannot change the current mute state, it only affects the default muted state.
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.
- Return the deafaultMuted property:
- Set the defaultMuted property:
audioObject.defaultMuted = true|false
- true|false: It is used to specify whether an audio should automatically start playing as soon as it is loaded or not.
Below program illustrates the Audio defaultMuted Property:
Example: Setting the audio to be muted by default.
- Before clicking the button:
- After clicking the button:
Supported Browsers: The browser supported by HTML | DOM Audio defaultMuted Property are listed below:
- Google Chrome
- Apple Safari