I'm trying to trigger the dropdown change event in jQuery (wordpress) but it's not working.
jQuery("select.buDropDown").each(function() { this.selectedIndex = 0 }).trigger('change');
Running this in console only changes the selectedIndex to 0, but never triggers the change event that shows/hides certain elements on the page.
However, running this in console, everything triggers fine:
$("select.buDropDown").each(function() { this.selectedIndex = 0 }).trigger('change');
I can't find any reasons why "$" would work but not "jQuery"
I tried wrapping it in:
jQuery(function($) {}
to be able to use $ instead, but in the wordpress code it still doesn't trigger the change events
Any ideas?
$is an alias forjQuery. Could you set up a working example of the problem in a jsfiddle.net.jQueryto$like this(function($){ ... /*code here*/ ... })(jQuery);