views:

46

answers:

2

Hello friends,

As per clients requirement, i have added a background music to webpage. I have set the music in loop mode to play it continuous. I have used <BGSOUND> tag to play the audio. The problem here is how to implement mute button so that client can mute the playing sound. I know nowadays its a bad idea to play automatic background music, but its the clients requirement. The page is simple static html.

Do anybody have the idea how to provide button to mute background sound?

Thanks for sharing your time.

+1  A: 

Use jquery

This question has already been answered here

Harsha Hulageri
Thanks Harsha, but i dont want any control, just simple BGSOUND.
IrfanRaza
+1  A: 

Make sure your BGSOUND has it's id attribute set, then it should be as simple as setting
the src attribute to blank :

document.all["bgsound_id"].src="";

Morten Bergfall
Thanks Morten, hopefully it will work. Let me check first.
IrfanRaza