JavaScript: Butona Tıklayınca Sayıyı Arttırma / Azaltma
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
<!doctype html> <html> <head> <meta charset="utf-8"> <style> input[type="button"]{ width: 200px; height: 200px; border:none; font-size:3em; background: #FF6766; color:#E7E7E7; } </style> <title>YAZILIM BİLİŞİM</title> </head> <body> <input type=button onclick="arttir()" value="+"> <input type=button onclick="azalt()" value="-"> <input type=button id="sonuc" value="0"> <script> function arttir(){ var sonuc=document.getElementById("sonuc"); sonuc.value=Number(sonuc.value)+1; } function azalt(){ var sonuc=document.getElementById("sonuc"); sonuc.value=Number(sonuc.value)-1; } </script> </body> </html> |
Add Comment