I need to replace characters inside specific tag using javascript when page loads. I have a big list of characters to be replaced. so it will be fast and should work with major browsers.
example:-
<p> The quick brown fox jumps over the lazy dog </p>
will need to looks like
<p> h=f t)ujh lk.,h ghy tfbm' bhjf ghy {>ht Frt </p>
Thanks!
Give
<p>an ID and you’re on your way:Javascript:
EDIT
To target all
<p>s, do as you said:You may have to run a
whileloop over the.replace()method, since calling it once will only do a single replacement (i.e. only 1 “c” will be replaced).