I have spans that contain words, and I'd like to figure out how to remove the last character using jquery. For instance:
<span>text inside</span>
would then be:
<span>text insid</span>
I thought it would be as simple as something like
$('span').last().remove();
But it doesn't seem like that works. It just removes the whole span element. Any ideas? Thanks!
const newString = someString.slice(0, -1)to get the string without the last character.last()function has nothing to do with text, so what on earth made you assume it was the right function to use?