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

173
Views
Compruebe si cada () índice 1 y índice 2 tiene .prop ('marcado')

¿Cómo verificar una función cada () si el primer y el segundo elemento coincidente tienen el accesorio verificado?

 $(document).on('click', '#submitBtn', function(e) { var $this = $(this), $checkboxItems = $('input:checkbox[name="checkbox-acceptance"]'); $checkboxItems.each(function( index ){ // if index 0 and index 1 have .prop( 'checked ' ) do stuff .. } })
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

No querrás usar each para esto. Simplemente verifique los valores con una indexación simple:

 if ($checkboxItems[0].checked && $checkboxItems[1].checked)
about 4 years ago · Juan Pablo Isaza Report

0

No sé de la existencia de each función, sin embargo, si necesita verificar si los dos primeros elementos de una matriz son verdaderos, optaré por la solución de @David Thomas

 $checkboxItems.slice(0,2).every((el) => el.value);
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!