I told you class was a tricky way to get the element. I think you want:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.pack.js"></script>
</head>
<body>
<div class="person">John S</div>
<div class="person">Bob Y</div>
<div class="person">Sally Q</div>
<script type="text/javascript">
$.each( $('.person'), function(i, p){$(p).text($(p).text().replace(/.$/, ''))});
</script>
</body>
</html>
Though there is a more native each (specific to jQuery objects only) that might work better (faster):
Code:
$('.person').each(function(){$(this).text($(this).text().replace(/.$/, ''))});
Bookmarks