9 Eylül 2021 Perşembe

Javascript Hesap Makinesi

 <html>

<head>

<title> başlık </title>

<script type="text/javascript">

function topla()

{

x=document.getElementById("txt1").value;

y=document.getElementById("txt2").value;

toplam=x+y;

alert(toplam);

}

function cikar()

{

x=document.getElementById("txt1").value;

y=document.getElementById("txt2").value;

fark=x-y;

alert(fark);

}

function carp()

{

x=document.getElementById("txt1").value;

y=document.getElementById("txt2").value;

carpim=x*y;

alert(carpim);

}

function bol()

{

x=document.getElementById("txt1").value;

y=document.getElementById("txt2").value;

bolum=x/y;

alert(bolum);

}

</script>

</head>

<body>

<table border=1 cellpadding=10>

<tr>

<td>1.sayi :</td><td><input type="text" id="txt1"/></td>

</tr>

<tr>

<td>2.sayi:</td><td><input type="text" id="txt2"/></td>

</tr>

<tr>

<td>islemler</td>

<td>

<input type="button" value="TOPLA" onclick="topla()"/>

<input type="button" value="ÇIKAR" onclick="cikar()"/>

<input type="button" value="ÇARP" onclick="carp()"/>

<input type="button" value="BÖL" onclick="bol()"/>

</td>

</tr>

</table>

</body>


</html>


Hiç yorum yok:

Yorum Gönder