Skip to content

Instantly share code, notes, and snippets.

@ehzawad
Created February 8, 2019 18:43
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/c91e96c32c40c67778d273670095a261 to your computer and use it in GitHub Desktop.
Save ehzawad/c91e96c32c40c67778d273670095a261 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>heck</title>
<script src="counter.js"></script>
</head>
<body>
<h1 id="myCounter">0</h1>
<button onClick="hellCount()">Increment</button>
</body>
</html>
let count = 0
function hellCount(){
count++
// const damn = document.querySelector("#myCounter").innerHTML
// let value = Number(damn)
//
// value = count;
// document.querySelector("#myCounter").innerHTML = String(value)
// Lol... You don't have to think of type
// doesn't matter
document.querySelector("#myCounter").innerHTML = count
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment