javascript - jquery calculations. Multiple div totals and grand total calc -


I'm trying to calculate the value * input value for many div, but not to ensure that How to do (.each) with? ??)

This is my bella:

You can see that I have commented on the part that is not working properly with it:

  & gt; // HAVING Trouble here !!! $ ('Total p span') each (function () {$ (this) .html ($ ('total p span'). Nearest (". Info") .html () * $ ('total p span' ). Nearest ("info"). (Find 'ticket input'). Val ());}); Most of the parts have to work well, when you keep some integer in different input fields and choose a different radio button, the individual calculations are closed. Especially because I have very limited knowledge of .each () or coping in calculating the specific things of specific things in each object.  

I know that this was not clear, originally there is a problem running .each () under // right here.

Also, if anyone can guess this answer for me I could not reproduce this bug for any reason at Bella, but this is another bug on my site . At the initial page load, if I do not choose anything on the radio button and select a value on the second or third ul ... grand total returns total $ NaN Unless I click on all the input fields, then it starts calculating correctly.

Thanks for any help!

What you want to do is the following:

  $ (' The total duration '). Each (function () {$ (this) .html ($ (This) .closest (". Info"). ('. Value p span'). Html () * $ (this) .closest (". Info" ) Search ('ticket input'). Val ());});   

The way you did it, on the move, the inner HTML for all these Span tags changed - as a result of which all were updated with the calculated amount for the last element. Gaya.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -