- Katılım
- 9 Ara 2020
- Konular
- 71
- Mesajlar
- 255
- Çözümler
- 1
- Tepki puanı
- 218
- Puanları
- 2,110
HTML:
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js"> <!--<![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<script src="" async defer></script>
<style>
#yaz{
width: 130px;
height: 40px;
background:#ccc;
font:30px tahoma;
color:#00f;
text-align: center;
margin-left: 20px;
}
</style>
<center>
<table>
<tr>
<td><div id="yaz">0</div></td>
</tr>
<tr>
<td><input type="number" placeholder="Sayı girin" id="yzsy"></td>
</tr>
<tr>
<td><input type="radio" name="t" id="top">Toplama<input type="radio" name="t" id="cık">Çıkarma<input type="radio" name="t" id="carp">Çarpma<input type="radio" name="t" id="bol">Bölme</td>
</tr>
</table>
</center>
<script type="text/javascript">
var sayilar=0
document.querySelector("#yzsy").onchange=function(){
var sayi = document.querySelector("#yzsy").value
if(document.querySelector("#top").checked){
sayilar = sayilar + parseInt(sayi)
}
else if(document.querySelector("#cık").checked){
sayilar = sayilar - parseInt(sayi)
}
else if(document.querySelector("#carp").checked){
sayilar = sayilar * parseInt(sayi)
}
else if(document.querySelector("#bol").checked){
sayilar = sayilar / parseInt(sayi)
}
else{
alert("Lütfen aşağıdan işlem seçin.")
}
document.querySelector("#yzsy").value=""
document.querySelector("#yaz").innerHTML=sayilar
}
</script>
</body>
</html>