Add .live or .on to jquery function
<p>I have some JavaScript that pulls how many items I have in my cart and places it in span.cartTotal for better styling.  I need the code to work so it pulls the information instantly and I don't have to refresh my page to see the update. I assume the code would require either jquery .live or .on to be added. Any help is much appreciated. Thank you</p>

<pre><code>$(function(){         
    if ($('#catCartSummary .cartSummaryItem').html() != 'Shopping cart is empty.') {
         var summary = $('#catCartSummary .cartSummaryItem').text().split(" ");
         var total = summary[0];
      $('span.cartTotal').html(total);
    }else{
      $('span.cartTotal').html("0");
    }
});
</code></pre>

<p>More info: My add to cart class is .productSubmitInput </p>

<p>I pull the info from this code below which is dynamically created. This cart total updates automatically in cartSummaryItem. I just need my new styled total to update from it when someone adds to cart. I tried the below suggestions but they didn't seem to work. I could be just adding something wrong.</p>

<pre><code>&lt;td class="cartSummaryItem"&gt;
1 item(s), Total: $10.95 
&lt;/td&gt; 
</code></pre>
