Created
June 29, 2017 07:45
-
-
Save ajmcagadas/ece982ca090190277df34f1ce4bd84c3 to your computer and use it in GitHub Desktop.
A sample of using javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Count Down</title> | |
| </head> | |
| <body> | |
| <h1 id="countDownContainer"></h1> | |
| <script> | |
| var container = document.getElementById('countDownContainer'); | |
| var num = 10; | |
| var interval = setInterval(function () { | |
| container.innerHTML = ''; | |
| container.innerHTML = num; | |
| num -= 1; | |
| console.log(num); | |
| if (num < 0) { | |
| num = 10; | |
| } | |
| }, 1000); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment