HTML DOM Audio volume Property
-- Learning is not just about technology, but also about dreams!
- Home
- HTML
- JavaScript
- CSS
- Vue
- React
- Python3
- Java
- C
- C++
- C#
- AI
- Go
- SQL
- Linux
- VS Code
- Bootstrap
- Git
- Local Bookmarks
JavaScript Reference
JavaScript Objects
JavaScript Array Object JavaScript Boolean Object JavaScript Date Object JavaScript Math Object JavaScript Number Object JavaScript String Object JavaScript RegExp Object JavaScript Global Properties/Functions JavaScript Operators JavaScript Error
Browser Objects
Window Object Navigator Object Screen Object History Object Location Object Storage Object
DOM Objects
HTML DOM Document Object HTML DOM Element Object HTML DOM Attribute Object HTML DOM Event Object HTML DOM Console Object CSSStyleDeclaration Object DOM HTMLCollection
HTML Objects
<a> <area> <audio> <base> <blockquote> <body> <button> <canvas> <col> <colgroup> <datalist> <del> <details> <dialog> <embed> <fieldset> <form> <iframe> <frameset > <img> <ins> <input> - button <input> - checkbox <input> - color <input> - date <input> - datetime <input> - datetime-local <input> - email <input> - file <input> - hidden <input> - image <input> - month <input> - number <input> - range <input> - password <input> - radio <input> - reset <input> - search <input> - submit <input> - text <input> - time <input> - url <input> - week <keygen> <link> <label> <legend> <li> <map> <menu> <menuItem> <meta> <meter> <object> <ol> <optgroup> <option> <param> <progress> <q> <script> <select> <source> <style> <table> <td> <th> <tr> <textarea> <title> <time> <track> <video>
Audio volume Property
Example
Set the audio volume to 20%:
document.getElementById("myAudio").volume = 0.2;
Definition and Usage
The volume property sets or returns the volume of the audio, from 0.0 (muted) to 1.0 (loudest).
Note: The <audio> element is new in HTML5.
Browser Support
The volume property is supported by all major browsers.
Note: Internet Explorer 8 or earlier browsers do not support this property.
Syntax
Return the volume property:
audioObject.volume
Set the volume property:
audioObject.volume=number
Property Values
| Value | Description |
|---|---|
| volumevalue | Specifies the current volume of the audio. Must be a number between 0.0 and 1.0. Example values: * 1.0 is highest volume (default) * 0.5 is half volume (50%) * 0.0 is muted |
Technical Details
| Return Value: | A number value representing the volume of the audio. |
|---|---|
| Default Value: | 1.0 |
Click to Share Notes
Write notes...
Image URL
Image Description
YouTip