Here's a quick question that's probably simpler than I'm thinking.
I'm populating a jQuery UI dialog with the resulting html from an $.ajax() call. In certain cases that html includes a button that when clicked, I want to close the containing dialog.
Assuming that I don't know anything about the element that was specified to be the dialog using $("#element").dialog()
...(i.e. I have no idea what the "#element" selector is from the dialog's inner content) - What's the best way to close the dialog from an element clicked inside of it?
Use closest()
$(this).closest('.ui-dialog-content').dialog('close');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With