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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:38:18+00:00 2026-06-16T02:38:18+00:00

I am trying to replace one whole row using JQuery but seems not working

  • 0

I am trying to replace one whole row using JQuery but seems not working ( the row is NOT being replaced). Here is the link to the example code: http://jsfiddle.net/s2kwb/

JavaScript:

$("td.99999").first().parent().next().replaceWith("<tr><td >category 3</td>
<td >2222</td>
<td >something 22</td>
<td >something 22</td>
<td >$3,433</td>
<td >$300</td>
<td >$3,733</td>
<td >$349</td>
<td >$4,082</td>
</tr>");​

Html:

<table border="1">
<tr >
  <th>category</th>
  <th>rank</th>
  <th>priority</th>
  <th>contact</th>
  <th>price</th>
  <th>tax</th>
  <th>total price</th>
  <th>shipping</th>
  <th>Net payment</th>
</tr>
<tr class="displaytagOddRow">
  <td class="99999">category 1</td>
  <td class="99999">99999</td>
  <td class="99999">something</td>
  <td class="99999">something</td>
  <td class="99999 alignRight">$3,433</td>
  <td class="99999 alignRight">$300</td>
  <td class="99999 alignRight">$3,733</td>
  <td class="99999 alignRight">$349</td>
  <td class="99999 alignRight">$4,082</td>
</tr>
<tr class="displaytagOddRow" style="Background-color:Red">
  <td class="3333">category 2</td>
  <td class="3333">3333</td>
  <td class="3333">something</td>
  <td class="3333">something</td>
  <td class="3333 alignRight">$3,433</td>
  <td class="3333 alignRight">$300</td>
  <td class="3333 alignRight">$3,733</td>
  <td class="3333 alignRight">$349</td>
  <td class="3333 alignRight">$4,082</td>
</tr>
</table>

What am I doing wrong?

Thanks in advance.

  • 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-16T02:38:19+00:00Added an answer on June 16, 2026 at 2:38 am

    Terminate the string for every line. See also the updated jsFiddle.

    $("td.99999").first().parent().next().replaceWith("<tr><td >category 3</td>" +
        "<td >2222</td>" +
        "<td >something 22</td>" +
        "<td >something 22</td>" +
        "<td >$3,433</td>" +
        "<td >$300</td>" +
        "<td >$3,733</td>" +
        "<td >$349</td>" +
        "<td >$4,082</td>" +
        "</tr>");​
    

    The Google JavaScript Style Guide recommends this string concatenation and advises against multiline strings with the alternative backslash line breaks.

    whitespace after the slash will result in tricky errors

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

Sidebar

Related Questions

I am trying to replace one regex pattern with another regex pattern. st_srt =
I'm trying to replace something like this: NSSomeFunction(@some var, @another one) With: NSSomeOhterFunction(@some var)
I'm trying to replace a bunch of Linux shell scripts with Scala scripts. One
I am trying to replace a value with a passed value using javascript or
I am trying to replace a large string in groovy. But can't get it
I am trying to replace a certain div element parent with another one newparent
I'm trying to get a similar effect to the one here (in this case
I am trying to replace div elements with button elements to improve accessibility, but
I am using SSMS 2008 and am trying to write a recursive replace statement.
I am working in VB.Net and trying to use Regex.Replace to format a string

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.