Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

96
Vistas
Getting sender in jQuery

I have a large list of check boxes all with unique id values. I'd like to get the id of the checkbox that executes my JavaScript function. Can I do this using $(this)?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You can get the target of the event using event.target.

$('input:checkbox[id]').change(function(event) {
  var checkboxID = $(event.target).attr('id');
  alert(checkboxID);
});

JSfiddle Demo

over 4 years ago · Santiago Trujillo Denunciar

0

If this points to your checkbox, then you would get the id using $(this).attr('id')

For example:

$('input:checkbox').click(function(){
    var id = $(this).attr('id');
    // do something with id
});

See DEMO.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda