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

106
Views
Jquery selecciona el elemento actual en la lista

Necesito seleccionar el elemento actual de la lista:

 $(".card.v1 .buy-wrapper input[type='number'], .coupon-quantity, .product-buy-wrapper input, .cart-item .buy-wrapper input, .card.v2 .buy-wrapper input[type='number']").on("change", function(e) { currentValue = $(this).val(); id = $(this).parent().find(".buy-button").data("product-id"); console.log(id); if (currentValue == 0) { $(this).parent().find(".buy-button").fadeIn("slow"); $(this).parent().find(".input-group").hide(); $(this).val("1"); } })

$ (esto) seleccione todos los ID de producto de datos en la lista de selectores y proporcione datos de otras entradas, solo necesito datos de la entrada modificada actual, no todos en la lista de selectores.

event.target.id devuelve indefinido.

UPD:

 <div class="buttons mt-2 d-flex"> <div class="buy-wrapper order-1 order-lg-0 mr-3"> <button type="button" data-product-id="<?= $value->id; ?>" class="btn btn-primary btn-lg buy-button">Buy</button> <input class="form-control qty" type="number" value="1" min="0" max="100" step="1"> </div> </div>

Este bloque también está en otros lugares.

about 4 years ago · Juan Pablo Isaza
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!