Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

jQuery - update value in class within specific div.

Posted on 2012-04-02
3
Medium Priority
?
326 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 1400 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:Gurvinder Pal Singh
Gurvinder Pal Singh earned 600 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

DOM Attributes and Properties treatment with jQuery 1.6 by Ivo Stoykov jQuery (http://jquery.com/) 1.6 introduces .prop() (http://api.jquery.com/prop/) and .removeProp() (http://api.jquery.com/removeProp/) methods which allow modifying or removi…
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 the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…
Suggested Courses

876 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