Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

369
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda