visuell-teller

This commit is contained in:
Geir Okkenhaug Jerstad 2024-08-16 14:01:43 +02:00
parent 83f69d397d
commit 859f8334d9
12 changed files with 140 additions and 74 deletions

View file

@ -7,8 +7,9 @@
</head>
<body>
<div id="output"></div><br>
<button onclick="setNum16(16)">Set Number to 16</button>
<button onclick="setNum47(47)">Set Number to 47</button>
<button onclick="setNum(16)">Set Number to 16</button>
<button onclick="setNum(47)">Set Number to 47</button>
<button onclick="increaseNum()">Increase number by 1</button>
<br><br>
<script>
@ -19,6 +20,10 @@
numToShow = selectedNum;
outputDiv.innerHTML = numToShow;
}
function increaseNum(){
numToShow++;
outputDiv.innerHTML = numToShow;
}
</script>
</body>