GBS
GBS

Reputation: 154

Modal message as javascript alert?

Im pretty new in Modal Alerts World and im trying to make modal messages as alerts inside a javascript function, first change the div innerHtml and then show the message i don't know if is posible.

<script type="text/javascript">

function myalert() {

 alert("My alert");

}

</script>

Im working with that example: http://jsfiddle.net/Hu55H/

As i said i need it like a onclick function, because i need to call it by javascript (like alerts).

Im just asking if is possible to do it.

Hope you all can help me!

Upvotes: 0

Views: 1065

Answers (1)

AdiT
AdiT

Reputation: 549

You need this, I think:

$('selector').dialog({
                resizable: false,
                height: 300,
                modal: true,
                draggable: false,
                buttons: {
                    YES: function () {
                        //Code

                    },
                    Cancel: function () {
                        //Code
                    }
                }
            });

Upvotes: 2

Related Questions