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

  • Home
  • SEARCH
  • 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 8908901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:18:02+00:00 2026-06-15T03:18:02+00:00

dI have a pre-existing block of html I need to alter using jQuery. The

  • 0

dI have a pre-existing block of html I need to alter using jQuery. The HTML looks as follows:

<div class="main">
    <div class="wms-column wms-column-nav">
        <div class="wms-column-nav-body">
        <div class="section">
            <h3>Recent News</h3>
            <ul class="other">
            <li>Something</li>
            </ul>
        </div>
        </div>
    </div>
</div>​

I need to target the H3 and change its inner text. However, with no IDs, targeting it with selectors is tricky. There are many other H3 tags through their site that cannot be changes, but have the same selector path. How can I target this H3 based on its content, and then change it? I’d prefer a method that inserts html and not text, as some special characters are going to be used.

Thanks!

  • 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-15T03:18:04+00:00Added an answer on June 15, 2026 at 3:18 am

    In vanilla Javascript :

    var elements = document.getElementsByTagName('h3');
    for (var i=elements.length; i-->0; ) {
        var element = elements[i];
        var text = element.textContent || element.innerText;
        if (text=='Recent News') {
           element.innerHTML = 'some new text';   
        }
    }
    

    Demonstration

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

Sidebar

Related Questions

I have a couple of pre-existing applications which I need to run in one
I have a pre-existing database, and this code: class User private() extends MongoRecord[User] with
I have a pre-existing public/private key pair for RSA encryption which I need to
I have some pre-existing js code that manipulates a div via DOM. I have
So I have this pre-existing database that I'm trying to connect to using Django
I have a lot of pre-existing BMPs (and our clients have pre-existing bmps as
I have recently begun working on a pre-existing PHP application, and am having a
I have all my content pre-escaped, so rather than using the triple stash everywhere
I have a pre-existing c++ object model which represents the business layer tier of
I have a pre-existing user database on my site. Now, I want to install

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.