close dialog when click outside jquery code example Example: jquery close another dialog $("#modalSearch").dialog('close');