0
   

onclick event

 
 
Reply Mon 22 Apr, 2013 06:49 pm
Beginner JavaScript USER.
Im trying to add an onclick event to rollover buttons created in fireworks. Not sure how to make the buttons function. HELP What am i missing or doing wrong??

<body>
<nav class="audiobutton">
<ul>
<li class="btnstop"><a href="javascript:stop()">Stop</a></li>
<li class="btnplay"><a href="javascript:play()">Play</a></li>
<li class="btnpause"><a href="javascript:pause()">Pause</a></li>

</ul>
</nav>

<audio id="audio">
<source src="thepressure.mp3">
<source src="thepressure.ogg">
Your browser does not support this.
</audio>

<script>
var myAudio=document.getElementById('audio');

function play() {
myAudio.play();
}
function pause() {
myAudio.pause();
}
function stop() {
myAudio.stop();
}


</script>
</body>
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 650 • Replies: 0
No top replies

 
 

Related Topics

 
  1. Forums
  2. » onclick event
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 05/14/2025 at 08:31:33