Programming Tips - Bootstrap / jQueryUI : Programmatically close a modal dialog

Date: 2019jul24 Update: 2026apr1 Library: Bootstrap Library: jQueryUI Language: javaScript Keywords: programmatically Q. Bootstrap / jQueryUI : Programmatically close a modal dialog A. First get a handle to the dialog (here we use jQuery):
const dlg = $('#mydialog'); // jQuery
In Bootstrap (versions 3 and 4):
dlg.modal('hide');
In jQueryUI:
dlg.dialog('close');