JEDNODUCHA KALKULACKA (2)

ID
Nazov / Name:
Popis / Description:
Dlzka / Length:
Testovane pod / Tested under:

 

077
p077.html / p077.zip
Jednoducha kalkulacka
2148b
NN 4.04, IE 4.0

UKAZKA / CLICK HERE

Zdrojovy tvar / Source code:

<html> <head> <title> JavaScript DESTINATION - P077 </title> <script language="JavaScript"> <!-- function compute(obj) { obj.result.value = eval(obj.expr.value) } function visa(obj, n) { var digit = 0; n = n.substring(1,2) obj.expr.value = obj.expr.value + n } function clean(obj) { obj.expr.value = ""; } function pi(obj){ obj.expr.value = obj.expr.value + Math.PI } // --> </script> </head> <body> <FORM NAME="evalform"> <INPUT TYPE="button" name="01" VALUE=" 1 " onClick="visa(this.form, value)"> <INPUT TYPE="button" name="02 " VALUE=" 2 " onClick="visa(this.form, name)"> <INPUT TYPE="button" name="03" VALUE=" 3 " onClick="visa(this.form, name)"> <INPUT TYPE="button" name="0+" VALUE=" + " onClick="visa(this.form, name)"> <INPUT TYPE="button" name="PI" VALUE=" PI" onClick="pi(this.form)"><BR> <INPUT TYPE="button" name="04" VALUE=" 4 " onClick="visa(this.form, name)"> <INPUT TYPE="button" name="05" VALUE=" 5 " onClick="visa(this.form, name)"> <INPUT TYPE="button" name="06" VALUE=" 6 " onClick="visa(this.form, name)"> <INPUT TYPE="button" name="0-" VALUE=" - " onClick="visa(this.form, name)"><BR> <INPUT TYPE="button" name="07" VALUE=" 7 " onClick="visa(this.form, name)"> <INPUT TYPE="button" name="08" VALUE=" 8 " onClick="visa(this.form, name)"> <INPUT TYPE="button" name="09" VALUE=" 9 " onClick="visa(this.form, name)"> <INPUT TYPE="button" name="0*" VALUE=" * " onClick="visa(this.form, name)"><BR> <INPUT TYPE="button" name="00" VALUE=" 0 " onClick="visa(this.form, name)"> <INPUT TYPE="button" name="0(" VALUE=" ( " onClick="visa(this.form, name)"> <INPUT TYPE="button" name="0)" VALUE=" ) " onClick="visa(this.form, name)"> <INPUT TYPE="button" name="0/" VALUE=" / " onClick="visa(this.form, name)"><BR> <INPUT TYPE="button" name="0." VALUE=" . " onClick="visa(this.form, name)"> <P> Napis vyraz : <INPUT TYPE=text NAME="expr" SIZE=23><BR> Vysledok : <INPUT TYPE=text NAME="result" SIZE=23> <BR> <INPUT TYPE="button" VALUE="Vypocitaj" onClick="compute(this.form)"> <INPUT TYPE="button" VALUE="Vymaz" onClick="clean(this.form)"> </FORM> </body> </html>
[ Navrat / BACK ]