tags:

views:

31

answers:

1

How do I create a function that will close the window after 2 seconds?

<a href="" onclick="close_it(); return false;">
    Click to close the window after 2 seconds
</a>
+3  A: 

You could use the setTimeout where an action is postponed for x number of milliseconds.

setTimeout(function(){
  window.close();
}, 2000);
Jonathan Sampson