In my Oracle APEX page, I have a modal dialog region with an inline dialog template. I am trying to trigger an action when the user clicks the close button on the dialog. Here is the code I have written:
$(".ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-icon-only.ui-dialog-titlebar-close").click(function (e) {
alert('Hi');
// actions
});
The HTML code for the dialog close button is shown below:
<button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close"
role="button" aria-disabled="false" title="Close">
<span class="ui-button-icon-primary ui-icon ui-icon-closethick"></span>
<span class="ui-button-text">Close</span></button>
However, this code is not working as expected. Can anyone help me identify what might be wrong?