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 6854519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:38:35+00:00 2026-05-27T01:38:35+00:00

I have the following html format <tr> <td width=80% style=padding-bottom: 3px class=ms-vb> <span class=ms-announcementtitle>

  • 0

I have the following html format

<tr>
    <td width="80%" style="padding-bottom: 3px" class="ms-vb">
        <span class="ms-announcementtitle">
            title is here 1
        </span>
        <br>
        by Ahmed 1
    </td>
</tr>
<tr>
    <td width="80%" style="padding-bottom: 3px" class="ms-vb">
        <span class="ms-announcementtitle">
            title is here 2
        </span>
        <br>
        by Ahmed 2
    </td>
</tr>
<tr>
    <td width="80%" style="padding-bottom: 3px" class="ms-vb">
        <span class="ms-announcementtitle">
            title is here 3
        </span>
        <br>
        by Ahmed 3
    </td>
</tr>

I want to replace text after <br> to be “Created By Admin” i.e. by Ahmed 1 --> Created by Admin and so on…

  • 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-05-27T01:38:36+00:00Added an answer on May 27, 2026 at 1:38 am

    Rather than manipulate the HTML of parent objects and cause much of the table to get reparsed, you can find and replace that text directly with this code that is a combination of jQuery and plain javascript:

    $(".ms-announcementtitle").each(function() {
        $(this).nextAll("br").get(0).nextSibling.nodeValue = "Created By Admin";
    });
    

    This finds the spans with class="ms-announcementtitle", then finds the <br> tag following it, then gets the DOM node for that and gets the nextSibling which will be the text node and finally changes it’s text directly.

    You can see it work here: http://jsfiddle.net/jfriend00/z5zVT/.

    jQuery doesn’t have many functions for dealing with text nodes and because the text you want to replace is not wrapped in it’s own container, it’s best to find the area with jQuery and then use a plain javascript operation to deal with the text node directly rather than modifying the innerHTML of a higher level container which causes everything in the container to be reparsed.

    If you control the HTML for this, it would be best to wrap the desired text in a <span class="creator"> and then you can target the contents of just that span in a much more direct way with something like this:

     $(".creator").text("Created by Admin");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following html format, <tr> <td width=80% style=padding-bottom: 3px class=ms-vb> <span class=ms-announcementtitle>
I have the following HTML table format: <table style=width: 100%;> <tr> <td> //How to
So I have some XML in the following format: <somenode> <html xmlns=http://www.w3.org/1999/xhtml> <head> <title/>
I have the following html code: <h3 id=headerid><span onclick=expandCollapse('headerid')>&uArr;</span>Header title</h3> I would like to
I have the following HTML code based on a tab menu format, i.e: <div
I have the following html.erb code that I'm looking to move to Haml: <span
I have the following html <div id=menu> <ul class=horizMenu> <li id=active><a href=# id=current>About</a></li> <li><a
I have the following HTML: <div id=footer> <div class=wrapper clear> <!-- stuff --> </div>
I have an url in the following format: http://example.com/realestate/index.php?page=services.html How can change it to
I have the following HTML in my MasterPage: <input class=button type=button value=Select User onclick='<%#

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.