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

83
Views
Detecting the change in inputs (jQuery)

There are several inputs and I want it to detect the variability in the input and give it the result. Currently, it works statically, I want to make it dynamically detect the digit change in the inputs.

I can do this with only 1 input but how can I do it for multiple inputs?

var allHaveSameValue = $(".inputclass").toArray().every(function(input, index, inputs) {
  return input.value === inputs[0].value;
});

console.log(allHaveSameValue);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="text" class="inputclass" value="1"/>
<input type="text" class="inputclass" value="1"/>
<input type="text" class="inputclass" value="1"/>
<input type="text" class="inputclass" value="1"/>

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

0

You can listen to the input event to run the check.

let $inputClass = $('.inputclass');
$inputClass.on('input', function(e){
  let val = $(this).val();
  let allHaveSameValue = $inputClass.toArray().every(input => input.value === val);
  console.log(allHaveSameValue);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type="text" class="inputclass" value="1"/>
<input type="text" class="inputclass" value="1"/>
<input type="text" class="inputclass" value="1"/>
<input type="text" class="inputclass" value="1"/>

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!