I need to change a bunch of different words on a page using jQuery. This is the code I have so far:
(function($) {
var thePage = $("body");
thePage.html(thePage.html().replace([/My Classes/g, 'My Levels'],));
})(jQuery)
How do I modify this code so I can find and replace more words? Lets say I also want to replace “dog” with “cat” and “boy” with “girl”.
What you could do is if you chain the replace values such as:
EDIT:
Here is the updated code with what you’ve provided on jsfiddle
And the jsfiddle link: