Prev Demo
Open A New Window And Close After 5 Seconds Automatically.
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <p>Click the below button to open a new window and wait for 5 seconds to close it automatically.</p> <input type="button" value="Open New Window" onclick="myOpen()"/> <script> function myOpen() { var a = window.open("", a, "width=500, height=300"); a.document.write("<div>This is TechFunda(New Window).</div>"); setTimeout(function () { a.close() }, 5000); } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output