title: generating dynamic div id using jquery ajax
body: <p>I want to assign unique id into HTML DIV dynamically created by jquery Ajax. </p>
  
  <pre><code>$.ajax({
          type: 'xxx',
          data: 'xxx',
          url: 'xxx',
          success: function(data) {
  
                  var repeatID =1;
  
                  $.each(data.data, function(i, v){
  
                      repeatID++;
  
                      //alert(repeatID);
  
                      $("#divId").append('&lt;div class="single" id="my_test_' + repeatID + '"&gt;'
                                                      +'&lt;div class="any_name"&gt; '+ v.Name +' &lt;/div&gt;&lt;/div&gt;');
                  });
          error:...
  });
  </code></pre>
  
  <p>I need to assign a unique id into class 'single'. Inside the each loop, repeatID is increasing outside append (like if I uncomment alert and there are 3 arrays returned by server then it will give alert message for three times.). But inside append it is not increasing. All the values remain the initially assigined value, 1. So, for the three DIV I got id 'my_test_1'.</p>
  
  <p>I am expecting to get 'my_test_1', 'my_test_2', 'my_test_3' if there are 3 arrays. Where I am doing the wrong?</p>
  
  <p>Any solution please?</p>