Bani pe net
Doriți să reacționați la acest mesaj? Creați un cont în câteva clickuri sau conectați-vă pentru a continua.

Script calculator

In jos

Script calculator Empty Script calculator

Mesaj  Admin Dum Ian 17, 2010 7:55 pm

Iti creaza un calculator , este functional , il puteti unde doriti pe site-ul dvs ...
Cod:

<script language="Javascript">
<!--
function Ergebnis()
{
var x = 0;
x = eval(window.document.Rechner.Display.value);
window.document.Rechner.Display.value = x;
}
function Hinzufuegen(Zeichen)
{
window.document.Rechner.Display.value =
window.document.Rechner.Display.value + Zeichen;
}
function Sonderfunktion(Funktion)
{
if(Funktion == "sqrt")
{
var x = 0;
x = eval(window.document.Rechner.Display.value);
window.document.Rechner.Display.value = Math.sqrt(x);
}
if(Funktion == "pow")
{
var x = 0;
x = eval(window.document.Rechner.Display.value);
window.document.Rechner.Display.value = x * x;
}
if(Funktion == "log")
{
var x = 0;
x = eval(window.document.Rechner.Display.value);
window.document.Rechner.Display.value = Math.log(x);
}
}
//-->
</script>


<form name="Rechner">
<table border=8 cellpadding=10>
<tr>
<td bgcolor=#C0C0C0><input name="Display" size=30 maxlength=30></td>
</tr>
<tr><td><table>
<tr>
<td width=50><input type=button value=" 7 " onClick="Hinzufuegen('7')"></td>
<td width=50><input type=button value=" 8 " onClick="Hinzufuegen('8')"></td>
<td width=70><input type=button value=" 9 " onClick="Hinzufuegen('9')"></td>
<td width=50><input type=button value=" + " onClick="Hinzufuegen('+')"></td>
</tr>
<tr>
<td width=50><input type=button value=" 4 " onClick="Hinzufuegen('4')"></td>
<td width=50><input type=button value=" 5 " onClick="Hinzufuegen('5')"></td>
<td width=70><input type=button value=" 6 " onClick="Hinzufuegen('6')"></td>
<td width=50><input type=button value=" - " onClick="Hinzufuegen('-')"></td>
</tr>
<tr>
<td width=50><input type=button value=" 1 " onClick="Hinzufuegen('1')"></td>
<td width=50><input type=button value=" 2 " onClick="Hinzufuegen('2')"></td>
<td width=70><input type=button value=" 3 " onClick="Hinzufuegen('3')"></td>
<td width=50><input type=button value=" * " onClick="Hinzufuegen('*')"></td>
</tr>
<tr>
<td width=50><input type=button value=" = " onClick="Ergebnis()"></td>
<td width=50><input type=button value=" 0 " onClick="Hinzufuegen('0')"></td>
<td width=70><input type=button value=" . " onClick="Hinzufuegen('.')"></td>
<td width=50><input type=button value=" / " onClick="Hinzufuegen('/')"></td>
</tr>
<tr>
<tr>
<td width=50><input type=button value="sqrt " onClick="Sonderfunktion('sqrt')"></td>
<td width=50><input type=button value=" pow " onClick="Sonderfunktion('pow')"></td>
<td width=70><input type=button value=" log " onClick="Sonderfunktion('log')"></td>
<td width=50><input type=reset value=" C "></td>
</tr>
</tr>
</table>
</td></tr></table>
</form>
Admin
Admin
Admin
Admin

Mesaje : 962
Data de inscriere : 24/11/2009
Varsta : 44
Localizare : Torino

http:// www.castiguri-garantate.info

Sus In jos

Sus

- Subiecte similare

 
Permisiunile acestui forum:
Nu puteti raspunde la subiectele acestui forum