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

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -