title: How to generate same elements in multiple divs?
body: <p>I have been trying to create onlick function in multiple divs by using shot codes in javascript but I end up creating multiple javascript codes with different ids and onclick function.</p>
  
  <p>I tried for loop function but it didn't work as well.</p>
  
  <pre><code>function copy() { 
    document.getElementById("label").innerHTML = document.getElementById("mySelect").value;
  }
  function copy2() { 
    document.getElementById("label2").innerHTML = document.getElementById("mySelect2").value;
  }
  function copy3() { 
    document.getElementById("label3").innerHTML = document.getElementById("mySelect3").value;
  }
  function copy4() { 
    document.getElementById("label4").innerHTML = document.getElementById("mySelect4").value;
  }
  function copy5() { 
    document.getElementById("label5").innerHTML = document.getElementById("mySelect5").value;
  }
  function copy6() { 
    document.getElementById("label6").innerHTML = document.getElementById("mySelect6").value;
  }
  function copy7() {
    document.getElementById("label7").innerHTML = document.getElementById("mySelect7").value;
  }
  function copy8() { 
    document.getElementById("label8").innerHTML = document.getElementById("mySelect8").value;
  }
  function copy9() { 
    document.getElementById("label9").innerHTML = document.getElementById("mySelect9").value;
  }
  function copy10() { 
    document.getElementById("label10").innerHTML = document.getElementById("mySelect10").value;
  }
  </code></pre>