<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="author" content="Roderick Divilbiss">
<meta name="copyright" content="© 2005, 2006 Roderick Divilbiss">
<title>How to play a WAV file on mouseover</title>
<script type="text/javascript">
<!--
function playSound(sndId) {
var sndObj=document.getElementById(sndId);
try {
sndObj.Play();
}
catch (e) {
sndObj.DoPlay();
}
}
-->
//-->
</script>
</head>
<body>
<div>
Mouseover: <span onmouseover="playSound('snd0');">Sound 1</span> | <span onmouseover="playSound('snd1');">Sound 2</span> | <span onmouseover="playSound('snd2');">Sound 3</span>
</div>
<embed id="snd0" src="/ee/newalert.wav" autostart="false" hidden="true" enablejavascript="true">
<embed id="snd1" src="/ee/type.wav" autostart="false" hidden="true" enablejavascript="true">
<embed id="snd2" src="/ee/xpinfbar.wav" autostart="false" hidden="true" enablejavascript="true">
</body>
</html>
© Coyright 2000-2008, Roderick (Rod) W. Divilbiss. Some rights reserved.
Except where otherwise noted, this site, all content, and all source code and markup is licensed under a Creative Commons License
Creative Commons License.
No part of this web site including all application code and examples may be used for commercial purposes without prior written permission from the author,
Roderick W. Divilbiss of Overland Park, Kansas, United States of America.