Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | DOM Audio volume Property

Improve Article
Save Article
  • Last Updated : 30 Jul, 2019
Improve Article
Save Article

The HTML DOM Audio volume property is used for set or return the current volume of the Audio element. The volume value 0.0 represents silent and 1.0 represents loudest.


  • It returns the volume property.
  • It sets the volume property.
    audio.volume = number

Property Values: It contains single property value number which represents the value of audio volume. The value of volume are:

  • 1.0: It is the highest volume. It is the default value.
  • 0.5: It is used to specify half volume.
  • 0.0: It is used to specify zero volume/mute/silent.

Return value: It returns a numeric value which represents the current volume of the Audio element.

Below program illustrates the Audio Volume property in HTML DOM:


<!DOCTYPE html> 
        HTML DOM Audio Volume Property 
<body style="text-align: center"
    <h1 style="color: green"
    <h2 style="font-family: Impact"
        HTML DOM Audio Volume Property 
    <audio id="Test_Audio" controls> 
        <source src
        <source src
    <button onclick="volume()" type="button">
        Return Volume
    <button onclick="Set_vol1()" type="button">
        Set HalfVolume
    <button onclick="Set_vol2()" type="button">
        Set Fullvolume 
        var gfg = document.getElementById("Test_Audio");
        function volume() { 
        function Set_vol1() { 
            gfg.volume = 0.2;
        function Set_vol2() { 
            gfg.volume = 1.0;


  • Before Clicking on the Button:
  • After Clicking on Return Volume Button:
  • After Clicking on SetHalfVolume Button:
  • After Clicking on SetFullVolume Button:

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!