title: I want to combine first function to the second one, so I can call it only once
body: <p>I want to combine first function to the second one, so I can call it only once. Basically i have 2 html5 audio files that im playing. Everything works fine.But if i play my first audio and during that time if i click the second audio the pause button on first audio doesn't change to default(off)</p>
  
  <pre><code>//First function 
  
  function toggleState(item) {
    if (item.className == "play") {
      item.className = "pause";
    } else {
      item.className = "play";
    }
  }
  
  //Second function
  // Play stop Music
  function EvalSound(soundobj) {
    var thissound = document.getElementById(soundobj);
    if (thissound.paused) {
      thissound.play();
    } else {
      thissound.pause();
    }
  }
  </code></pre>