View Full Version : Trying to truncate a string in JQuery

11-20-2008, 06:50 PM

I have the following code:

<div class="person">John S</div>

Is is possible in JQuery to remove the last letter of the text within the div class "person"?

I'm banging my head off a brick wall trying to figure this out, any help would be greatly appreciated.

Thanks in advance

11-21-2008, 09:22 AM
var cls='person'; // Name of the class you are referring

11-21-2008, 12:16 PM
Something strange is happening, I have 3 <div>'s with this class on it and after applying the code each div now contains the 3 people's names with only the last name with the surname removed. Any ideas on where I might be going wrong?