JavaScript simple calculation
问题 I'm pretty sure I'm being stupid but why isn't this working!? form.find( '.per_time' ).on( 'change', function() { var price = parseInt( form.find( '.section-price' ).attr('data-price'), 10 ) ; var multiplier = parseInt( $( this ).val(), 10 ); var newprice = (price / 7) * multiplier; form.find( '.section-price .price' ).html( newprice ) }) It's this line I'm concerned about: var newprice = (price / 7) * multiplier; The calculation is not dividing by 7, it only calculates price * multiplier ?