It it working partially, but how do I get the below to work with multiple audio files:
<!DOCTYPE HTML>
<html>
<body>
<script language="javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
$(function(){
var birdhover = $('.birds');
var birdaudio = birdhover.find('audio')[0];
birdhover.hover(function(){
birdaudio.play();
}, function(){
birdaudio.stop();
});
});
</script>
<div class="birds" style="width:30px;height:30px;background-image:url(image1.gif');cursor:pointer;">
<audio src="sound1.ogg" preload="auto"></audio>
</div>
<div class="birds" style="width:30px;height:30px;background-image:url('/home/imran/Desktop/images/vowel_short_2.gif');cursor:pointer;">
(image2.gif');cursor:pointer;">
<audio src="sound2.ogg" preload="auto"></audio>
</div>
</body>
</html>
Both images play the same sound.