I would advise the following. Don't use
confirm
. Not only such dialogs are not flexible; they are ugly, inconvenient and hardly can be suitable for production-grade sites. Much better idea is using so called
modal popup approach. Please see my article where I explain how they work, how you can create your own one, and discuss the alternatives, including
confirm
and other native JavaScript dialogs:
Modal Popup From Scratch[
^].
Most popular implementation of modal popup is jQuery
Dialog
and many 3rd-party jQuery
plug-ins:
Dialog | jQuery UI[
^],
Let me google that for you[
^].
—SA