This commit is contained in:
2022-04-11 09:00:52 +02:00
parent c97d7c42c9
commit f4ae53338c
11 changed files with 236 additions and 35 deletions

View File

@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Click counter</title>
</head>
<body>
<div id="counter">
Szamlalo
</div><br><br><br>
<div>
<button id="button1" onclick="gomb1()" align="left">Gomb1</button>
<button id="button2" onclick="gomb2()" align="middle">Gomb2</button>
<button id="button3" onclick="gomb3()" align="right">Gomb3</button>
</div>
<div id="kiiras"></div>
<script src="script.js"></script>
</body>
</html>

View File

@@ -0,0 +1,14 @@
let click_counter = 0;
function gomb1(){
document.getElementById("kiiras").innerHTML = "Gomb1 lett megnyomva";
document.getElementById("counter").innerHTML = ++click_counter;
}
function gomb2(){
document.getElementById("kiiras").innerHTML = "Gomb2 lett megnyomva";
document.getElementById("counter").innerHTML = ++click_counter;
}
function gomb3(){
document.getElementById("kiiras").innerHTML = "Gomb3 lett megnyomva";
document.getElementById("counter").innerHTML = ++click_counter;
}