title: Get value jQuery from PHP dynamic generated select
body: <p>I have a php script which display some dynamic select. I would like to get value from each select in jQuery script. An idea to help me?</p>
  <p>PHP</p>
  <pre><code>$result = mysql_query(&quot;select * from $table where id='$id'&quot;);
  $r = mysql_fetch_array($result);
  $result[1]=$r['result_1'];
  $result[2]=$r['result_2'];
  $result[3]=$r['result_3'];
  $result[4]=$r['result_4'];
  $result[5]=$r['result_5'];
  
  for($i=1;$i&lt;=5;$i++)
  {
      if($result[$i]!=&quot;0&quot;)
      {
       echo '&lt;select id=&quot;myresult_$i&quot;&gt;&lt;option value=&quot;$result[$i]&quot;&gt;$result[$i]&lt;/option&gt;&lt;/select&gt;';
      }
  }
  
  echo '&lt;div class=&quot;addmyprod&quot; id=&quot;addprod_'.$id.'&quot; idprod=&quot;'.$id.'&quot;&gt;ADD&lt;/div&gt;';
  </code></pre>
  <p>jQuery</p>
  <pre><code>$(&quot;.addmyprod&quot;).on('click', function() 
  {
      var idprod= $('#addprod_'+$(this).attr('idprod')).attr('idprod');
      console.log(idprod);
  
      var myresult_1= ?????
      console.log(myresult_1);
  
      var myresult_2= ?????
      console.log(myresult_2);
  
      var myresult_3= ?????
      console.log(myresult_3);
  
      var myresult_4= ?????
      console.log(myresult_4);
  
      var myresult_5= ?????
      console.log(myresult_5);
              
  }); 
  </code></pre>