+ 6

Javascript restart prog

I do a little program in Javascript. I wanted to do a prompt wich ask if yes or not restart the prog. how can I do ? Thanks :)

27th Jul 2017, 6:57 PM
NoxFly
NoxFly - avatar
2 odpowiedzi
+ 10
var restart = confirm("Restart the game?"); if (restart) doSomething; else doNothing;
27th Jul 2017, 7:04 PM
The Coding Sloth
The Coding Sloth - avatar
+ 7
thanks !
27th Jul 2017, 7:14 PM
NoxFly
NoxFly - avatar