I am parsing the following query string:
/?alt_name=test&test=brand&old=Superman&new=Batman
and get this Object {alt_name: "Giggitty", test: "brand", old: "Supco", new: "Batman"}.
How would I go about creating a script that if the test=brand replace inner html instances of the word Superman(old) with the word Batman(new)?
Any help is greatly appriciated.
Edit. HTML would help although a super simple example will suffice.
<html>
<body>
<div>
<p>Superman and some other text</p>
</div>
</body>
</html>
Basically I just want every instance of the word Superman, or whatever the parsed value for old, to be replaced with whatever the parsed value for new is, in this case Batman.