Here's my code:
$("#success").dialog({
    modal: true,
    title: 'Payment success',
    width: 400,
});
How can I show an OK button in this dialog?
Use Buttons option and see the Modal Message.
$("#success").dialog({
  modal:true,
  title:'Payment success',
  width:400,
  buttons: {
    Ok: function() {
      $( this ).dialog( "close" );
    }
  }
});
                        $("#success").dialog({modal:true,title:'Payment success',width:400,buttons{"Ok":execute,"Cancel": cancel}});
var execute = function()
{
    alert('This is Ok button');
}
var cancel = function()
{
    alert('This is Cancel button');
}
That should work.
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