Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

jQuery - update value in class within specific div.

Posted on 2012-04-02
3
Medium Priority
?
323 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
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…

722 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