jQuery Removing specific text from an element -
i want remove text "by:" element in website. want rest of text remain there. how can achieve jquery? thank you.
the html
<div id="text">by: anonymous minnesota</div>
i want be:
<div id="text">anonymous minnesota</div>
if wanted find every element "by:" in , remove it, try this:
$(':contains("by:")').each(function(){ $(this).html($(this).html().split("by:").join("")); });
this removes occurrence of "by:" in element. if want target specfic type of elements, change $(':contains("by:")')
include whatever selector suits you.
Comments
Post a Comment