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

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -