title: JQuery replace all text for element containing string in id
body: <p>I am trying to select all elements on the page which have the string 'aggr' as part of their id value. Then I am trying to replace the text 'Sum 'in these elements to 'Total'.</p>
  
  <p>My JQuery is below but doesn't seem to be working....</p>
  
  <pre><code>$('TBODY[id*=aggr]').each(function(i){
  var aggrHTML = $('TBODY[id*=aggr]');
            var aggrText = aggrHTML.text();
            var newText = aggrText.replace("Sum","Total Holiday Leave")
           aggrHTML.html(newText);
  });
  </code></pre>