Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

377
Visualizações
Audio mute and unmute button in html

I am creating an HTML page with multiple audios. I want a mute button which can mute all audios of that page together so that even we play another audio even if it plays but we can not hear anything.

I am referring the code mentioned here.

But it only creates a Toggle button, but not mute the audio.

The audio tags used on the page are like below:

            <audio id="audio_playo24">
                <source src="voice/vo3.mp3" type="audio/mp3" />
            </audio>

Can anyone please point me in the correct direction?

Thank you.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Try once with this code it will work fine.

JavaScript Code

function toggleMute() {
   var myAudio = document.getElementById('audio_playo24');
   myAudio.muted = !myAudio.muted;
}

HTML Code

<audio id="audio_playo24" controls>
   <source src="voice/vo3.mp3" type="audio/mp3" />
</audio>
<a href="javascript:void(0);" onclick="toggleMute()">Mute/Unmute</a>
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda