I want to remove the text \"By:\" from an element in my website. I want the rest of the text to remain there. How can I achieve that with jQuery? Thank you.
The HTML
var str = $("#text").text();
$("#text").text(str.substring(3));
By: Anonymous From Minnesota
Using javascript's substring and give your div an ID to access it easily:
html:
By: Anonymous From Minnesota
jquery:
var str = $("#text").text();
$("#text").text(str.substring(3));
You could do it in one line too:
$("#text").text($("#text").text().substring(3));