jQuery - update value in class within specific div.

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>
sabecsAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
elliottbenzleConnect With a Mentor Commented:
$("#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
 
Gurvinder Pal SinghConnect With a Mentor Commented:
this much should be enough
$("#remove_blue_box"+id + " .left_box_qty" ).html(newQty);
0
 
sabecsAuthor Commented:
Thanks..
0
All Courses

From novice to tech pro — start learning today.