Skip to content
Advertisement

jQuery onChange only running once

I have jQuery function in a WordPress Woo form that basically based on the dropdown fills in certain fields, the jQuery only executes once however. The code:

JavaScript

How do I get it to always run onChange not just the once.

Advertisement

Answer

If 1st time select working and 2nd time not then need to reset value of select on mouseenter event like in my snippet code.

Don’t need to write document ready statement For both static and dynamic select changes.
Something like this.

jQuery(document).on(‘change’, ‘select’, function (e) {
// do something
});

I hope below snippet will help you a lot.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement