change of Select (dropdown) within div NOT showing id of dropdown / select

change of Select (dropdown) within div NOT showing id of dropdown / select

Dear Sir  

pls refer

in this screen

click select product

When I click i get id name as foodiv0


X Delete

My Jquery Script 
  1. $('[id^="foodiv"]').change( function() {  
  2. $('#cls').text($(this).attr("id"));
  3. var thisid=this.id;
  4.  alert("product id0="+thisid);
  5. $('#cls').append($('#'+thisid).val());
  6. });

i am getting alert foodiv0
 i had changed dropdown or select whose id is product 0

this drop down is slected dynamically
Code that populates the row and dropdown
  1. function addItem() { /* function to add a row  */   ;
  2.   var rowcount=$('#rowcount').val(); 
  3.   var rc=parseInt(rowcount);
  4. $('#rowcount').val(rc+1); 
  5. var url= "add2sessionvariable.php";
  6.     data = {
  7.     rowcount : rowcount
  8.   }
  9.   
  10.     $('#add2sessionvariable').load(url,data)  ;
  11.   var rowclass="rowclass"+rowcount;
  12. var row="row"+rowcount;
  13.       var itemRow =
  14.         '<div class="s-12 l-12">'+
  15. '<div class="s-12 l-1 dropdown " id="srnodiv'+rowcount+'" style="padding:20px;"  ><input name="srno'+rowcount+'"  id="srno'+rowcount+'" type="text" class="'+rowclass+'">    </div>' +
  16.          '<div class="s-12 l-3 dropdown " id="foodiv'+rowcount+'" style="padding:20px;"  >   </div>' +
  17.         '<div class="s-12 l-1 dropdown " id="qtydiv'+rowcount+'" style="padding:20px;"  ><input name="qty'+rowcount+'"  id="qty'+rowcount+'" type="text" class="'+rowclass+'">    </div>' +
  18.         '<div class="s-12 l-1 dropdown" id="ratediv'+rowcount+'" style="padding:20px;"  ><input name="rate'+rowcount+'"  id="rate'+rowcount+'" type="text" class="'+rowclass+'">    </div>' +
  19.         '<div class="s-12 l-1 dropdown " id="amountdiv'+rowcount+'" style="padding:20px;"  ><input name="amount'+rowcount+'"  id="amount'+rowcount+'" type="text" class="'+rowclass+'">    </div>' +
  20.         '<div class="s-12 l-2 dropdown delete" id="delete'+rowcount+'"  style="padding:20px;font-size:18px; cursor:pointer;"> X Delete </div>' +
  21.  
  22.          '</div>';
  23.      $("#pblock").append(itemRow); 
  24.  


  25.  $('#productdiv'+rowcount).text(rowcount);
  26.  
  27.  //$('#committeeposition'+rowcount).text(rowcount);
  28.  
  29.  var url= "add2productdropdown.php";
  30.      data = {
  31.     rowcount : rowcount
  32.   }   
  33. $('#foodiv'+rowcount).load(url,data);


  34.  //var url= "add2committeepositiondropdown.php";
  35. //     data = {
  36. //   rowcount : rowcount
  37. // }
  38. //$('#committeeposition'+rowcount).load(url,data);;
  39.  
  40.     
  41.  
  42. }
  43.  addItem(); //call function on load to add the first item

  44. /////// company name //// 
  45.  $('#companyid').change ( function() {  
  46. var companyid= $('#companyid').val();
  47.  var url= "companydetailfill.php"; 
  48.     data = {
  49.      
  50. companyid: companyid // COmpany id is passed //
  51. }
  52.     $('#companydetaildiv').load(url,data, copytodeliveryaddress)  ; 
  53.  
  54. });