Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda