0
<head>   
<script type="text/javascript"> 
function playPause(x)           
{ 
    var myAudio=document.getElementById(x); 
  if (myAudio.paused) 
    myAudio.play(); 
  else 
    myAudio.pause(); 
} 
</script>
<head>
<body>

<audio id="Soundx1" src="../audio/2.mp3"></audio>  
<button style="background-image:url(../images/audio1.jpg); width:45px; height:45px;    
border:transparent; margin:0px 0px 0px 0px;background-repeat:     
no-repeat;background-color:white;" onclick="playPause('Soundx1');" ></button>

<audio id="Soundx2" src="../audio/2.mp3"></audio>  
<button style="background-image:url(../images/audio2.jpg);background-color:white;     
width:45px; height:45px; border:transparent; margin:0px 0px 0px 0px;background-repeat:    
no-repeat;" onclick="playPause('Soundx2');" ></button>
<body>

<Article moved from Java to JavaScript by JamesCherrill>

Edited by JamesCherrill: Moved to JavaScript forum - this is not Java

2
Contributors
1
Reply
11
Views
4 Years
Discussion Span
Last Post by stultuske
1
  1. I don't see any question in your post
  2. this is the Java forum. Java (unlike it's name might suggest) is not related to JavaScript. this post might be more for this forum
  3. there is no big mistery in performing several actions on a single button click. what exactly is your point?
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.