Solved

jQuery - update value in class within specific div.

Posted on 2012-04-02
3
311 Views
Last Modified: 2012-04-02
Hi, if id is equal to 1164 and newQty is 14 how should I code the line below in order to update
<div class="left_box_qty">2</div>  
to
<div class="left_box_qty">14</div>

Thanks in advance for your comments.

$("#remove_blue_box"+id+".left_box_qty").html(newQty);      


<div id="remove_blue_box1164" > 
                 <div class="blue_box_break_line"></div>
                    <div class="left_box_qty">2</div>  
             <div class="left_box_price">$ 39.00</div>
</div>
         
<div id="remove_blue_box1054" > 
                 <div class="blue_box_break_line"></div>
                 <div class="left_box_qty">1</div>  
             <div class="left_box_price">$ 29.00</div>
</div>
0
Comment
Question by:sabecs
3 Comments
 
LVL 4

Accepted Solution

by:
elliottbenzle earned 350 total points
ID: 37795990
$("#remove_blue_box1164 .left_box_qty").html("newQty");

In your code, try putting a space before the .left_box_qty

$("#remove_blue_box"+id+" .left_box_qty").html(newQty);
0
 
LVL 40

Assisted Solution

by:gurvinder372
gurvinder372 earned 150 total points
ID: 37796000
this much should be enough
$("#remove_blue_box"+id + " .left_box_qty" ).html(newQty);
0
 

Author Closing Comment

by:sabecs
ID: 37796076
Thanks..
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Jquery autocomplete 10 67
Automatically open all pdf links in new tab 2 37
Back to top of page link does not animate with this jquery codes 9 19
Error in JQuery 5 34
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now