呼叫下拉列表事件



我需要在其他地方调用下面的下拉更改事件。我该怎么做?

 $('#ddlService').change(function () {
                        if ($(this).val() !== $(this).find('option:eq(0)').attr('value')) {
                            if (petValidation()) {
                                showCommonLayout();
                                defaultLoadMethod();
                            } else {
                                hideCommonLayout();
                            }
                        }
                    });

我需要在这里调用上面的事件:

$('#providerCancel').on('click', function () {
//I need to call above clouser here
  return false;
});

使用 .trigger()

$('#ddlService').trigger('change');

$('#ddlService').change();

最新更新