Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <head>
- <meta charset="utf-8">
- </head>
- <body>
- <p id="text"></p>
- <script>
- alert("Aplikacja do odliczania");
- for(i=1; i>0; i++){
- var sekundy = parseInt(prompt('podaj czas w sekundach'));
- var milisekundy = sekundy*1000+1000;
- var odlicz = sekundy+1;
- if(isNaN(sekundy)){
- alert("podaj wartość liczbową");
- }
- else{
- var napis = setInterval(czas,1000);
- function czas(){
- document.getElementById("text").innerHTML += (odlicz-=1)+" ";
- }
- var koniec = setTimeout(stop, milisekundy);
- function stop(){
- clearInterval(napis);
- alert("Czas minął")
- }
- }
- }
- </script>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement