I have a very simple js attached to a form, and I cannot see why it is not executing.
(function ($) {
alert("test");
$('#field-ai-event-date-unique-add-more-wrapper').hide();
$('#field-ai-event-date-range-add-more-wrapper').hide();
})(jQuery);
The alert is popping up as expected, the jQuery instructions are not executed. They work fine in the console and hide the form elements as expected.
What is the problem here?
alert
does not work (OK, that you excluded), there may be some error message in console (what message), they may get executed before'#field-ai-event-date-unique-add-more-wrapper
is created, and so on... Last but not least, why aren't you using behaviors?