title: Javascript function and buttons
body: <p>i want to make many music buttons but everytime doing new buttons and new audio.this is my code</p>
  
  <p>javascript</p>
  
  <pre><code>audio = new Audio();
  
  audio.src = "music/examples.mp3"
  audio.loop = false;
  
  function play1() {
    audio.play();
  }
  
  function pause1() {
    audio.pause();
  }
  
  var audio2 = new Audio();
  audio2.src = "music/examples1.mp3"
  audio2.loop = false;
  
  function play2() {
    audio2.play();
  }
  
  function pause2() {
    audio2.pause();
  }
  </code></pre>
  
  <p>html</p>
  
  <pre><code>&lt;button onclick="play1()"&gt;&lt;/button&gt;
  &lt;button onclick="pause1()"&gt;&lt;i class="fa fa-pause-circle" style="color: #848484"&gt;&lt;/i&gt;
  &lt;/button&gt;
  &lt;/i&gt; -examples1
  &lt;br&gt;
  
  &lt;button onclick="play2()"&gt;&lt;/button&gt;
  &lt;button onclick="pause2()"&gt;&lt;i class="fa fa-pause-circle" style="color: #848484"&gt;&lt;/i&gt;
  &lt;/button&gt;
  &lt;/i&gt; examples
  &lt;br&gt;
  
  &lt;button onclick="play3()"&gt;&lt;/button&gt;
  &lt;button onclick="pause3()"&gt;&lt;i class="fa fa-pause-circle" style="color: #848484"&gt;&lt;/i&gt;
  &lt;/button&gt;
  &lt;/i&gt; -examples3
  &lt;br&gt;
  </code></pre>
  
  <p>I want a single audio and single fonction that will run all of them</p>