Using Javascript/jQuery, I would like to find and replace all instances of "foo" to bar, but ignore any instances of "foo" that happen to be attribute values.
Example:
<p><a class="foo" id="foo" href="foo.html">foo</a>foo</a></p>
Should become
<p><a class="foo" id="foo" href="foo.html"><span class="fixed">bar</span></a></p>
This example is the problem I am running into....
<h3><a id="foo" name="foo">About foo</a></h3>
In that example, the attributes of the link get changed too
About foo
` In that example, the attributes of the link get changed too – Hochmania May 15 '17 at 16:59