This is related to a previous question I asked with Jquery. If I have multiple tables throughout a webpage as shown below. Is it possible to find the name after Edited by: and replace it with something else. The name will always be different and replaced with “anon”. The suggested example I’ve been using is from my previous question works perfectly but in there I know the class and ID of my div, How would I do it with contents within the table element?
Many thanks
<script type="text/javascript">
$(document).ready(function() {
$('div.blogEntries div.entry span').remove();
$('.entryFooter').each(function() {
var html_arr = $(this).html().split(' ');
html_arr[2] = 'anonymous';
$(this).html(html_arr.join(' '));
});
});
</script>
<table border="0">
<tbody style="border-radius: 8px 8px 8px 8px;">
<tr>
<td>
An example post
<br>
Edited by: joe at 03/11/2011 14:09
<br>
<br>
</td>
</tr>
</tbody>
</table>
You can use regular expression to replace html: