title: How do i pass a javascript var into a function?
body: <p>how do I pass play_ID into the the function toggleSound()?</p>
  
  <pre><code>onclick=\"javascript:var play_ID=$id;toggleSound();\"
  &lt;script type=\"text/javascript\"&gt;
  
  &lt;script type=\"text/javascript\"&gt;
      function toggleSound() {
          audioElem = document.getElementById(\"audio". $row["ID"]."\");
          if (audioElem.paused)
              audioElem.play();
          else
              audioElem.pause();
      }
  &lt;/script&gt;
  </code></pre>