Clément Andraud
Clément Andraud

Reputation: 9269

Chrome/Safari jquery event on click not trigger

I have an event with jquery like :

$(document).on('click', '.etatChange > option', function() {

When i test on Mozilla it's ok, but with Chrome or Safari the event is not trigged... Do you know why ?

Upvotes: 0

Views: 107

Answers (2)

Beri
Beri

Reputation: 11610

Tried putting it under document ready and change event to change? You are not clicking on option, you are changing select value here.

$(document).ready(function(){
  $(document).on('change', '.etatChange', function() {
  }
});

Upvotes: 1

James Donnelly
James Donnelly

Reputation: 128791

If you want to detect when a select element's value changes, you should use the change event:

$(document).on('change', '.etatChange', function() { ... });

Upvotes: 2

Related Questions