I took this sample piece of code from the below link
How do I close a dialog using jQuery?
$(function () {
$("a:contains('sometext')").click(function() {
var NewDialog = $('<div id="MenuDialog">\
<p>This is your dialog content, which can be multiline and dynamic.</p>\
</div>');
NewDialog.dialog({
modal: true,
title: "title",
show: 'clip',
hide: 'clip',
buttons: [
{text: "Submit", click: function() {doSomething()}}
]
});
return false;
});
});
Here instead of the value doSomething I need to use a variable. For eg:- if i have a variable temp=confirm, the value confirm should be used there. so when i clicked the button the function confirm should be invoked.
How can i achieve this?