D
D
Denis99992018-03-09 16:51:58
JavaScript
Denis9999, 2018-03-09 16:51:58

Can't hang jQuery event on select?

This form is generated by a WordPress plugin. Address - probegsrs.ru/appointment
You need to hang an event on the drop-down list under SELECT A BRAND. But the problem is that, based on the generated select, a drop-down list is built, which is not in the html code. And not on one of them it is impossible to hang up an event, but on some label it is hung up.
What is the reason here, maybe this drop-down list appears later and because of this does not work?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ihor Bratukh, 2018-06-05
@BRAGA96

Try like this:

$(window).on('load', function() {
  $('select').on('click', function() {
    // ...
  });
});

$(document).on('click', 'select', function() {
  // ...
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question