Hii
ich werd hier gleich irre oder ein Computermörder... wieso schreibt dieses sche+ss script die parameter der funktionen nicht ins eingabefeld??????? ich versteh das NICHT  
  
  
 ich sitz hier schon stunden...
HTML
		
					
				<html>
<head>
<title>Rechner</title>
<script type="text/javascript">
<!--
zaehler = 0;
zeichen[] = new Array();
function Number(Num){
  val = window.document.Rechner.Display.value;
  if(zaehler!=0 && val.isNaN()) {
    zaehler++;
  }
  window.document.Rechner.Display.value = window.document.Rechner.Display.value + Num;
}
function Operator(Op){
  zaehler++;
  window.document.Rechner.Display.value=Op;
  zeichen[zaehler]=Op;
}
function Calculate(){
var result = 0;
  for(i=0; i<zeichen.length; i++) {
    if(i!=0) {
      if(zeichen[i].isNan()){
         switch(zeichen[i]) {
           case '+': result += zeichen[i+1];
           case '-': result -= zeichen[i+1];
           case '*': result *= zeichen[i+1];
           case '/': result /= zeichen[i+1];
         }
      }
    } else {
      result = zeichen[i];
    }
  }
  window.document.Rechner.Display.value=result;
}
//-->
</script>
</head><body>
<form name="Rechner" action="">
<input type="text" name="Display"> <input type="button" value=" + " onClick="Operator('+')"><input type="button" value=" - " onClick="Operator('-')"><input type="button" value=" x " onClick="Operator('*')"><input type="button" value=" / " onClick="Operator('/')"><input type="button" value=" = " onClick="Calculate()">
<table border="5">
<tr><td><input type="button" value="  7  " onClick="Number('7')"></td><td><input type="button" value="  8  " onClick="Number('8')"></td><td><input type="button" value="  9  " onClick="Number('9')"></td></tr>
<tr><td><input type="button" value="  4  " onClick="Number('4')"></td><td><input type="button" value="  5  " onClick="Number('5')"></td><td><input type="button" value="  6  " onClick="Number('6')"></td></tr>
<tr><td><input type="button" value="  1  " onClick="Number('1')"></td><td><input type="button" value="  2  " onClick="Number('2')"></td><td><input type="button" value="  3  " onClick="Number('3')"></td></tr>
</table>
</form>
</body>
</html>
	
			Alles anzeigen