Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
Multiply in jQuery, but one number is from rangeslider, any help would be appreciated

Problem in calculating live changing number i cannot multiply two numbers, one is live ( changing with slider,secon script) so i need to multiply the numbers

<script>
$('#customer-worth').on('keyup', function(){
  $('#lafinale-profit').text(($(this).val()*($'#closed-deals-roi-calc'.val()))); //this here is the problem. I dont know how to live update number from other script (closed-deals-roi-calc)
});
</script>

<script>
$('.fs-rangeslider_track').on('touchstart',function(e){
    $('#closed-deals-roi-calc').text(((parseFloat($('#number-from- 
       slider').innerText)/100*8.7)).toFixed(1));
</script>  
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

To do what you require, add an input event handler to both the text and the range slider. This event handler is what performs the calculation from the values in those controls and updates the required element in the DOM, something like this:

let updateUi = () => $('#lafinale-profit').text(($('#customer-worth').val() * $('#closed-deals-roi-calc').val()) || 0);

$('#customer-worth, #closed-deals-roi-calc').on('input', updateUi);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.0/jquery.min.js"></script>
Customer worth: <input type="number" id="customer-worth" value="1" />
ROI calc: <input type="range" min="1" max="10" id="closed-deals-roi-calc" value="5" />

<div id="lafinale-profit"></div>

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!