Created
March 31, 2017 02:08
-
-
Save jl91/269e7d0c84624dcefb231fdaf89cd246 to your computer and use it in GitHub Desktop.
This file contains 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="pt-br"> | |
<head> | |
<meta charset="utf-8"> | |
</head> | |
<body> | |
<input type="text" readonly="readonly" name="numbers"> | |
<button id="plus" onclick="plus()">+</button> | |
<button id="minus" onclick="minus()">-</button> | |
<script> | |
var counter = 0; | |
var numbers = document.getElementsByName('numbers')[0]; | |
numbers.value = counter; | |
function plus() { | |
numbers.value++; | |
} | |
function minus() { | |
numbers.value--; | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment