startit/oppgaver/uke1/visuell-teller.html

26 lines
636 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<button onclick="countUp()">tell oppover</button>
<button onclick="conutDown()">tell nedover</button>
<div id="tall">0</div>
<script>
let count = 0;
function countUp() {
++count;
document.getElementById('tall').innerHTML = count;
}
function conutDown(){
--count;
document.getElementById('tall').innerHTML = count;
}
</script>
</body>
</html>