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

81
Views
jQuery ID comienza con

Estoy tratando de obtener todos los elementos con una identificación que comience con algún valor. A continuación se muestra mi código jQuery. Estoy tratando de usar una variable de JavaScript cuando busco artículos. Pero no funciona. ¿Qué me estoy perdiendo a continuación? Entonces, el 'valor' de identificación que estoy buscando es el valor del elemento en el que se hizo clic

 $(document).ready(function() { $('input[name$="_chkmulti"]').click(function(){ var value = $(this).val(); $("td[id^= + value +]").each(function(){ alert("yes"); }); }); });
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

tratar:

 $("td[id^=" + value + "]")
over 4 years ago · Santiago Trujillo Report

0

Aquí tienes:

 $('td[id^="' + value +'"]')

entonces, si el valor es, por ejemplo 'foo' , entonces el selector será 'td[id^="foo"]' .

Tenga en cuenta que las comillas son obligatorias : [id^="...."] .

Fuente: http://api.jquery.com/attribute-starts-with-selector/

over 4 years ago · Santiago Trujillo 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!