Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8998739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:04:35+00:00 2026-06-16T00:04:35+00:00

I have a web page for the Podunk company. But every time Podunk appears

  • 0

I have a web page for the Podunk company. But every time Podunk appears on the page (no matter where it is) it needs to be shown as Podunk!

Note that this is ANYWHERE on the page so it could be in header tags, list tags, in multiple nested DIVs, etc.

What is the best way to go about this? I’m thinking that jQuery is the better solution (as opposed to CSS) but I don’t know how to go about it? Can someone please provide a code snippet for this kind of replacement on an entire page element.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:04:35+00:00Added an answer on June 16, 2026 at 12:04 am

    My original answer was incorrect (as pointed out in the comment 🙂 ) I have edited this answer to include the correct solution.

    var rgx = /Podunk/g;
    $("body *")
        .contents()
        .filter(function() {
            if (this.nodeType !== 3){
                return false;
            }
            return true;
        })
        .each(function(){
            var $this = $(this);
            var txt = $this.text();
            if (rgx.test(txt)){
                $this.replaceWith("<span>" + txt.replace(rgx,"<span class='podunk'>Podunk</span>") + "</span>");
            };
        });​
    

    This has the downside that any element that has only Podunk in it gets and additional span element. ie, if you have

    <a>Podunk</a> 
    

    you end up with

    <a><span><span class="podunk">Podunk</span></span>. 
    

    I think with a little consideration this could be overcome.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this web page that works fine in one webhost but not in
I have this web page that begins with <!-- DOCTYPE html --> , which
I have web page that looks like this: Image on the left - text
I have a web page that consists of a checkbox (parent) and on this
I have a web page that needs references to jQuery and Blueprint and extjs,
I have a web-page that looks like this (simplified example) <table id=events_results_table> <thead> <tr>
I have web page i want that when page is loaded after some time
I have a web page that lists open jobs at a company, in the
new on rails and using windows for now,, i have web page that user
I have web forms page that has 2 controls. A gridview and an associated

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.