You cannot do this with the native confirm() , since it blocks the execution of JavaScript on this page until the user "answers", but there are many HTML / JavaScript-based add-ons where you can easily add this behavior. <sh> And they often look better. :)
Take a look at https://stackoverflow.com/a/42568/ ... for an example. To create a timeout, you simply window.setTimeout(function() { $('#dialog').dialog('close'); }, 120000); open a dialogue.
Thiefmaster
source share