This is a little less obvious in jQuery than you would expect at first glance. There are 2 ways to do it, either invoke the specific dialog:
onclick="$('#myDialog').dialog('close');"
or locate it, assuming that you're clicking a child element ( in the titlebar or body):
onclick="$(this).closest('.ui-dialog').children('.ui-dialog-content').dialog('close');"
The latter is pretty much the only way to close an anonymous dialog unless you want to wire in a tracking system for your windows.