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

219
Vistas
Change event doesn't work in console (Safari and Chrome) on some sites

I've been working on automation of user events for some stores but got stuck on cart page for https://shop.advanceautoparts.com/. I've been trying to fire any possible event on input field but it doesn't do same as user inputing data manually. Change event is detected on input but is there any additional events that making "Apply" button usable?

I've been trying with both jQuery and vanilla JS but nothing seems to work.

$(document).ready(function() {
    $('input[name="promoCode"]').blur();
     $('input[name="promoCode"]').focus(); 
    $('input[name="promoCode"]').attr('value','Example')[0].dispatchEvent(new Event('change', { bubbles: true }));
    $('input[name="promoCode"]').val('Example1')[0].dispatchEvent(new Event('change', { bubbles: true }));
    $('input[name="promoCode"]').blur();
          setTimeout( function () { 
    $('button[aria-label="Apply"]').removeAttr('disabled');
            $('button[aria-label="Apply"]').get(0).dispatchEvent(new MouseEvent('click', { view: window, bubbles: true, cancelable: true }))
          }, 100);
    setTimeout( function () { 
    $('button[aria-label="Apply"]').removeAttr('disabled');
            $('button[aria-label="Apply"]').get(0).dispatchEvent(new MouseEvent('mousedown', { view: window, bubbles: true, cancelable: true }))
          }, 200);
    setTimeout( function () { 
    $('button[aria-label="Apply"]').removeAttr('disabled');
            $('button[aria-label="Apply"]').click();
          }, 300);
 });

The click Event shouldn't be the issue as when I input something maually and fire

$('button[aria-label="Apply"]').click();

then everything is processing normally. Any idea?

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