jquery is not refreshing the function
<p>I have a jquery function  that suppose to delete last dynamic created div 
it delete first time but when I try to delete again it's giving me </p>

<p>Microsoft JScript runtime error: 'null' is null or not an object</p>

<pre><code>&lt;script type="text/javascript"&gt;
  jQuery("btnDeleteALineButton").click(function(e){
    var lineCount = GetServiceLineCount();
    if(lineCount &gt; 0 ){
      $('ctrlServiceLine'+lineCount).remove();
      lineCount = lineCount -1;
    }
    //e.preventDefault()
  });
&lt;/script&gt;
</code></pre>

<p>When I put alert I see that firt time give lineCount correct but never do -1</p>

<p>can some one please help me</p>
