Hii,
I found this worked for me in the end (note the third line overriding the open function which find the button and hides it):
$("#div2").dialog({
closeOnEscape: false,
open: function(event, ui) {
$(".ui-dialog-titlebar-close", ui.dialog || ui).hide();
}
});
To hide the close button on all dialogs you can use the following CSS too:
.ui-dialog-titlebar-close {
visibility: hidden;
}
Thank You!!