Skip to content

Instantly share code, notes, and snippets.

@ehzawad
Created February 9, 2019 19:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ehzawad/3f1ed421b36c989bea4cfa4b041c750d to your computer and use it in GitHub Desktop.
Save ehzawad/3f1ed421b36c989bea4cfa4b041c750d to your computer and use it in GitHub Desktop.
document.addEventListener('DOMContentLoaded', function() {
document.querySelector('button').onclick = count
})
let counter = 0
function count() {
counter++
document.querySelector('#counter').innerHTML = counter
if (counter % 10 === 0) {
alert(`My Fortnite score is at ${counter}!`)
}
}
@ehzawad
Copy link
Author

ehzawad commented Feb 9, 2019

<!DOCTYPE html>
<html>
  <head>
    <script src="hell.js">

    </script>
    <title>
    ehzawad
    </title>
  </head>
  <body>
    <h1 id="counter">0</h1>
    <button onClick="hi()">Click</button>
  </body>
</html>

@ehzawad
Copy link
Author

ehzawad commented Feb 9, 2019

let counter = 0

document.addEventListener('DOMContentLoaded', function() {
  document.querySelector('button').onclick = function() {
    counter++
    document.querySelector('#counter').innerHTML = counter

    if (counter % 10 === 0) {
      alert(`My Fortnite score is at ${counter}!`)
    }
  }
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment