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

163
Views
one rep max calculator

rep max calculator and I'm having a bit of an error with my calculation.

the formula for calculation is (((weight*reps)*0.0333)+weight)

const submit = document.querySelector('.submit');
let weight = document.querySelector('#weight');
let reps = document.querySelector('#reps');

submit.addEventListener('click', function() {
  result = (((weight.value * reps.value) * 0.0333) + weight.value);
  console.log(result);
})
<div class="cardbody">
  <label for="weight"> Lift:</label>
  <input class="input" id="weight" type="text" name="weight" placeholder="weight" required>
  <label for="reps"> Reps:</label>
  <input class="input" id="reps" type="text" name="Reps" placeholder="Repitions" required>
</div>

<div class="cardsubmit">
  <button class="submit">Submit</button>
</div>

now I tried to manually enter my variables so in the javascript made the weight=165 and reps=6 the output that I'm expecting is 197.96 and what I'm getting is 32.967, what I noticed is that my program is not adding the weight at the end.(((weight*reps)*0.0333)+{{weight}}) << I put in double brackets

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The problem here is that weight.value is a string

You need to convertIt to number to add it correctly I've used +weight.value but you can use parseInt instead

const submit = document.querySelector('.submit');
let weight= document.querySelector('#weight');
let reps= document.querySelector('#reps');



submit.addEventListener('click', function(){
    result = +weight.value +(((weight.value * reps.value)*0.0333));
    console.log(result);
})
<div class="cardbody">
    
        <label for="weight"> Lift:</label>
        <input class="input" id="weight" type="text" name="weight" placeholder="weight" required>
        <label for="reps"> Reps:</label>
           
        <input class="input" id="reps" type="text" name="Reps" placeholder="Repitions" required>
        </div>
        
        <div class="cardsubmit">
        
       <button class="submit">Submit</button>
    

</div>

about 4 years ago · Juan Pablo Isaza 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!