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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:31:12+00:00 2026-06-06T13:31:12+00:00

I have html that looks like this with several items <div class=item> <p class=price>$388.00</p>

  • 0

I have html that looks like this with several items

<div class="item">
    <p class="price">$388.00</p>
         <p class="part_number">VM2327T23A00T</p>
         <p class="real_price"></p>
      </div>
      <div class="item">
    <p class="price">$88.00</p>
         <p class="part_number">AA327T23A00T</p>
         <p class="real_price"></p>
      </div>
      <div class="item">
      <p class="price">$38.00</p>
         <p class="part_number">AA327T23A00T</p>
         <p class="real_price"></p>
      </div>

etc..

I am trying to iterate through each item and set its “real_price” to a value here is my code:

  jQuery('.part_number').each(function () {
                    parts.push(SearchSpring.jQuery(this).text());

                    SearchSpring.jQuery.ajax(
            {
                type: "POST",
                url: "RealTimePricing.aspx/TestInteraction",
                data: "{param1:'brit', param2: 'nick'}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                async: true,
                cache: false,
                success: function (msg) {                 
                   jQuery("#real_price").html(msg.d);

                }
            }
        );
      });

                }

I am getting the correct “msg” on success (I can see this in firebug) but it never sets the html, also it only iterates through the each 1 time..

I am not sure why this isnt setting the html

  jQuery("#real_price").html(msg.d);

And why is my code not looping through all the “.part_number” tags in the html?

  • 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-06T13:31:14+00:00Added an answer on June 6, 2026 at 1:31 pm

    class="real_price" implies .real_price, but you have to make sure you’re updating the correct element as well (there are several elements with that class). I suggest using .next as the element to update is next to each .part_number element:

    jQuery(".part_number").each(function() {
       var $elem = jQuery(this).next(".real_price");
    

    and then:

    $elem.html(msg.d);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some HTML that looks like this: <div> <div class=value> <a href=# class=clicker>Some
I have some HTML that looks like this: <div class=product> Content In Here <div
I have some HTML that looks like this: <div class=MyClass></div> <div class=MyClass></div> <div class=MyClass></div>
If I have some HTML that looks like this: <div id=text> This is some
So I have some html that looks like the following: <div class='something unknown' id='something_unknown_1'>
I have an html table that looks like this in a standard HTML 4.01
I have a composite control which emits HTML that looks like this <span id=myControl>
Absolute beginner question: I have a template file index.html that looks like this: ...
I have a model that looks something like this: public class SampleModel { public
Let's say i have an index.php that has html in it that looks like

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.