user331914
user331914

Reputation:

Background music for a web page game

I am making a game in an HTML web page. How would I add music to this game?

Upvotes: 0

Views: 6264

Answers (2)

alejandrobog
alejandrobog

Reputation: 2101

Try this

<embed src="success.wav" autostart=false loop=false>

You may use javascript also

function func1() { 
document.all.sound.src = "sound.wav"
} 
window.onload=func1; 

Upvotes: 1

zed_0xff
zed_0xff

Reputation: 33217

<embed src="bgsound.mp3" autostart="true">

http://www.htmlf1.com/tutorial/html-background-music.html

Upvotes: 3

Related Questions