I am using the following code to make the text red in any span with the class code and which contains text 'Failed to send invite'. This works however the table is part of pagination results set and the pagination is updated via ajax so when they change the page of results the red color is lost.
How do I make this code work in way the will work with the ajax content.
//This works for setting red in the initial page load
$('table span.code').each( function() {
if( /(Failed to send invite)/.test($(this).html())) {
$(this).css('color', 'red');
}
});