javascript - Find part of string throughout site and replace with new text -


i still having trouble understanding regex. not sure if can target whole page...but without knowledge of how format regex, getting play it.

i have trademarked name appears throughout page. i'd use js add (r) end of every time appears.

can jquery/js accomplish this?

$("body").each(function() {   this.innerhtml = this.innerhtml.replace(                'breathe right',                 'breathe right(r)'); }); 

thanks!

this use case css :after pseudo-element:

css

.product-name:after {     content: " \00ae"; /* add restricted symbol after every element product-name class */ } 

html

<span class="product-name">my product</span> 

working demo

the easiest way wrap product name in span , tag class. i'm not sure if that's less work adding symbol markup begin with, though.

the benefit of approach allow apply other styles product name, bolding text or changing font color.

you can read more :after pseudo-element here.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -