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

115
Views
Why only single change event is working on select element in jQuery?

I need to change behavior of jQuery library (date range picker), it have code like this:

box.find('.month').off("change").change(function(evt) {
    dateChanged($(this));
});
box.find('.year').off("change").change(function(evt) {
    dateChanged($(this));
});

Those are two select elements. It don't return false and functions inside handler don't access the event. But for some reason my events that use delegation doesn't work. They are ignored.

$picker.on('change', 'select', function() {
   console.log('CHANGE');
});

The console log is not executing, but if I remove previous lines from the library, my event delegation code works fine.

NOTE: $picker is object in my code that is parent of box element. But I also have event added on $(document) that is also not working.

First time I see something like this. Adding event directly to element, prevents event propagation. Can someone explain what is happening here? Is this documented anywhere?

This happens in Firefox and Chrome.

If someone need simple example, I can create one. But thought that this is self explanatory.

EDIT: I've created a simple reproduction and it works fine. I have complex application with a lot of files (R Shiny Application), but I don't see any change events in dev tools. Are there any way of making the event not propagate? Maybe using event capturing. What should I search for in order to find the code that is preventing the events from propagating?

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!