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

165
Views
Marque solo no discapacitados

Tengo una secuencia de casillas de verificación que se pueden deshabilitar o no a través de deshabilitado en la etiqueta de entrada

Al hacer clic en la casilla de verificación principal, solo necesito que se marquen aquellos que NO están deshabilitados

Actual y deseada:

ingrese la descripción de la imagen aquí ingrese la descripción de la imagen aquí

Código hasta ahora:

 $("#checkAll").click(function () { $("input:checkbox").not(this).prop("checked", this.checked); });
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Puede usar el selector :not() combinado con el selector de atributos has :

 $("#checkAll").change(function () { $("input:checkbox:not([disabled])").prop("checked", this.checked); });
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <input type="checkbox" id="checkAll" /> <input type="checkbox" /> <input type="checkbox" disabled /> <input type="checkbox" /> <input type="checkbox" disabled /> <input type="checkbox" />

Como sugiere @connexo , debe usar .change() en lugar de .click() . Ver esta respuesta para más información.

about 4 years ago · Juan Pablo Isaza Report

0

Vanilla JS, siempre preferido:

 document.getElementById('checkAll').addEventListener('change', function() { for (const cb of document.querySelectorAll('input[type=checkbox]:not([disabled])')) { if (cb !== this) cb.checked = this.checked; } });
 <input type="checkbox" id="checkAll" /> <input type="checkbox" /> <input type="checkbox" disabled /> <input type="checkbox" /> <input type="checkbox" disabled /> <input type="checkbox" />

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!