Ceturtdiena, 2024-10-03, 2:22 PM
Sveicināti Viesis

Viss Izklaidei

Vietnes izvēlne
Dienasgrāmatas sadaļas
Mūsu aptauja
Novērte Mājas Lapu
Atbilžu kopskaits: 72
Mini-čats
200
Sākums » 2009 » Marts » 14 » kalkulators [uCoz]
kalkulators [uCoz]
4:14 PM

Script Kods :

Code
<html>
<head>
<title>calculator</title>
</head>
<script language="javascript">
operand=0;

function a()
{
document.f1.a1.value=document.f1.a1.value+"1";
}
function b()
{
document.f1.a1.value=document.f1.a1.value+"2";
}
function c()
{
document.f1.a1.value=document.f1.a1.value+"3";
}
function d()
{
document.f1.a1.value=document.f1.a1.value+"4";
}
function e()
{
document.f1.a1.value=document.f1.a1.value+"5";
}
function f()
{
document.f1.a1.value=document.f1.a1.value+"6";
}
function g()
{
document.f1.a1.value=document.f1.a1.value+"7";
}
function h()
{
document.f1.a1.value=document.f1.a1.value+"8";
}
function i()
{
document.f1.a1.value=document.f1.a1.value+"9";
}
function j()
{
document.f1.a1.value=document.f1.a1.value+"0";
}
function k()
{
//document.f1.a1.value=document.f1.a1.value+"+";
moq=h;
operandi1=document.f1.a1.value;
document.f1.a1.value="";
}
function l()
{
//document.f1.a1.value=document.f1.a1.value+"-";
moq=g;
operandi1=document.f1.a1.value;
document.f1.a1.value="";
}
function m()
{
//document.f1.a1.value=document.f1.a1.value+"=";
if(moq==h)
{
shedegi=parseInt(operandi1)+parseInt(document.f1.a1.value);
document.f1.a1.value=shedegi;
}
if(moq==g)
{
shedegi=parseInt(operandi1)-parseInt(document.f1.a1.value);
document.f1.a1.value=shedegi;
}
if(moq==j)
{
shedegi=parseInt(operandi1)/parseInt(document.f1.a1.value);
document.f1.a1.value=shedegi;
}
if(moq==k)
{
shedegi=parseInt(operandi1)*parseInt(document.f1.a1.value);
document.f1.a1.value=shedegi;
}
}

function n()
{
//document.f1.a1.value=document.f1.a1.value+"/";
moq=j;
operandi1=document.f1.a1.value;
document.f1.a1.value="";
}
function o()
{
//document.f1.a1.value=document.f1.a1.value+"x";
moq=k;
operandi1=document.f1.a1.value;
document.f1.a1.value="";
}
</script>
<body>
<form name="f1" action="" method="get" function>

<table border="3" bgcolor="#000000" bordercolor="#878787">
<tr>
<td><center>Calculator By Cilveeks</center></td>
</tr>
<tr>
<td>
<input type="text" name="a1" value="">
</td>
</tr>
<tr>
<td>
<input type="button" value="1" onclick="a();">

<input type="button" value="2" onclick="b();">

<input type="button" value="3" onclick="c();">

<input type="reset" value="Tirit">    

</td>
</tr>
<br />
<tr>
<td>
<input type="button" value="4" onclick="d();">

<input type="button" value="5" onclick="e();">

<input type="button" value="6" onclick="f();">
</td>
</tr>
<tr >
<td>
<input type="button" value="7" onclick="g();">

<input type="button" value="8" onclick="h();">

<input type="button" value="9" onclick="i();">

</td>
</tr>
<tr>
<td>
<input type="button" value="0" onclick="j();">

<input type="button" value="+" onclick="k();">

<input type="button" value="-" onclick="l();">
</td>
</tr>
<tr>
<td>
<input type="button" value="=" onclick="m();">

<input type="button" value="/" onclick="n();">

<input type="button" value="x" onclick="o();">
</td>
</tr>
<table>
</form>
</body>
</html>

Kategorija: Pamācības [uCoz] | Skatījumu skaits: 598 | Pievienoja: FreeFrag | Reitings: 0.0/0 |
Komentāru kopskaits: 0
Pievienot komentārus var tikai reģistrētie lietotāji.
[ Reģistrācija | Ieeja ]
Ieejas forma
Kalendārs
«  Marts 2009  »
PrOTCPkSSv
      1
2345678
9101112131415
16171819202122
23242526272829
3031
Meklēšana
Vietnes draugi
Banneri :
 


-//Tr*X//-Clan The Best !
 


 
Nobalso :
 
Drīz...
 
Statistika

Kopā Online: 15
Viesi: 15
Lietotāji: 0