jquery - deleting last character from span text? -
i have span element text. keep on appending based on events. works fine using $("#id").append(txt);
. not able delete it. tried using $("#id").slice(0, -1)
$("#id").val().slice(0, -1);
values displayed on page remain same. should using substr
or something? tried google couldn't come this? possible using jquery?
you can use this:
$(selector).text(function(i,v){ return v.slice(0,-4); });
Comments
Post a Comment