title: how to counter last value with length+1?
body: <p>I have form like this :</p>
  
  <pre><code>&lt;div id='add_field' class='locbutton'&gt;&lt;a href='#' title='Add'&gt;Add&lt;/a&gt;&lt;/div&gt;
  &lt;div id='remove_field' class='locbutton2'&gt;&lt;a href='#' title='Delete'&gt;Delete&lt;/a&gt;&lt;/div&gt;
  &lt;div id='idisikpi'&gt;
  &lt;div id='idheadisi1' class='headisi'&gt;
  &lt;div class='performancedetail'&gt;&lt;input type='text' name='idperformancedetail[1][]' 
  value='2' id='idperformancedetail[1][]'&gt;&lt;/div&gt;
  &lt;div class='performancedetail'&gt;&lt;input type='text' name='idperformancedetail[2][]' 
  value='9' id='idperformancedetail[2][]'&gt;&lt;/div&gt;
  &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>This is the jquery script :</p>
  
  <pre><code>function CreateInput()
  {
  
      var $headisi = $("&lt;div&gt;"),
      $idperformancedetail=$("&lt;div&gt;");
  
    var headisi_count = $("div.headisi").length+1;
    var idperformancedetail_count = 
    $("[id^='idperformancedetail']").last().val().length+1;
  
    $headisi.addClass("headisi");
    $idperformancedetail.addClass("performancedetail");
  
    var $input_idperformancedetail = $("&lt;input&gt;")
  
    $input_idperformancedetail
      .attr("name", "idperformancedetail["+headisi_count+"][]")
      .attr("type", "text")
      .attr("id", "idperformancedetail["+headisi_count+"][]")
      .attr("value", idperformancedetail_count);
    $idperformancedetail.append($input_idperformancedetail);
  
      $headisi.append($idperformancedetail);
  
    return $headisi;
  }
  
  
  
  $("#add_field a").click(function(e)
  {
  $("#idisikpi").append(CreateInput());
  
  e.preventDefault();
  });
  
  $("#remove_field a").click(function(e){
  $("#idisikpi div.headisi:last-child").remove();
  CalculateTotal();
  
  e.preventDefault();
  });
  </code></pre>
  
  <p>I want the next input is counter from last value of idperformancedetail, i want value on the next input like 10,11,12,...What can i do to get counter value on the next input ? Please Help me :(</p>