Created
December 11, 2022 02:08
-
-
Save Neodevils/0a80c875279010fd9de3e93f7efbf196 to your computer and use it in GitHub Desktop.
Sayı Arttırma veya Azaltma
This file contains hidden or 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> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>@neodevils</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<label for="sayi" id="saymaNumarasi">0</label> | |
<button id="azaltmaButonu" onclick="azaltmaButonu()">Azalt</button> | |
<button id="sifirlamaButonu" onclick="sifirlamaButonu()">Sıfırla</button> | |
<button id="arttirmaButonu" onclick="arttirmaButonu()">Arttır</button> | |
<script src="script.js"></script> | |
</body> | |
</html> |
This file contains hidden or 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
let sayi = 0; | |
let numara = document.getElementById("saymaNumarasi"); | |
function azaltmaButonu() { | |
sayi -= 1; | |
numara.innerHTML = sayi; | |
} | |
function sifirlamaButonu() { | |
sayi = 0; | |
numara.innerHTML = sayi; | |
} | |
function arttirmaButonu() { | |
sayi += 1; | |
numara.innerHTML = sayi; | |
} |
This file contains hidden or 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
body { | |
background-color: dimgray; | |
} | |
#saymaNumarasi { | |
display: block; | |
font-family: monospace; | |
font-weight: 700; | |
font-size: 24px; | |
right: 30px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment