Davidforthewin
Neues Mitglied
Hallo zusammen,
ich bin gerade dabei mir einen einfachen Taschenrechner Gadget zu erstellen.
der code sieht bist jetzt so aus:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Unicode" />
<link rel="stylesheet" type="text/css" href="gadget_style.css" />
</head>
<body>
<script type="text/javascript">
function Mal(){
var Ergebnis = document.Formular.Erste_Zahl.value * document.Formular.Zweite_Zahl.value;
document.Formular.Ausgabe1.value= Ergebnis;
function Plus(){
var Ergebnis = document.Formular.Erste_Zahl.value + document.Formular.Zweite_Zahl.value;
document.Formular.Ausgabe1.value= Ergebnis;
function Minus(){
var Ergebnis = document.Formular.Erste_Zahl.value - document.Formular.Zweite_Zahl.value;
document.Formular.Ausgabe1.value= Ergebnis;
function Geteilt(){
var Ergebnis = document.Formular.Erste_Zahl.value / document.Formular.Zweite_Zahl.value;
document.Formular.Ausgabe1.value= Ergebnis;
if(Ergebnis>100){
document.Formular.Ausgabe2.value="Geht nicht";
}
}
</script>
<form name="Formular" action="">
<br>
<br>
    <input type="text" name="Erste_Zahl" size="4">
    <input type="text" name="Zweite_Zahl" size="4">
<br>
<br>
<button type="button"> <img src="images/mal.png" width="32" height="32" onclick="Mal()"> </button>
<button type="button"> <img src="images/plus.png" width="32" height="32" onclick="Plus()"> </button>
<button type="button"> <img src="images/minus.png" width="32" height="32" onclick="Minus()"> </button>
<button type="button"> <img src="images/geteilt.png" width="32" height="32" onclick="Geteilt()"> </button>
<br>
<br>
<br>
        <input type="text" name="Ausgabe1" value="Ergebnis" size="10">
</form>
</body>
Wo liegt denn der Fehler? .. Wenn ich was berechnen will, gibt er nichts aus.
(Bin ein Anfänger)
ich bin gerade dabei mir einen einfachen Taschenrechner Gadget zu erstellen.
der code sieht bist jetzt so aus:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Unicode" />
<link rel="stylesheet" type="text/css" href="gadget_style.css" />
</head>
<body>
<script type="text/javascript">
function Mal(){
var Ergebnis = document.Formular.Erste_Zahl.value * document.Formular.Zweite_Zahl.value;
document.Formular.Ausgabe1.value= Ergebnis;
function Plus(){
var Ergebnis = document.Formular.Erste_Zahl.value + document.Formular.Zweite_Zahl.value;
document.Formular.Ausgabe1.value= Ergebnis;
function Minus(){
var Ergebnis = document.Formular.Erste_Zahl.value - document.Formular.Zweite_Zahl.value;
document.Formular.Ausgabe1.value= Ergebnis;
function Geteilt(){
var Ergebnis = document.Formular.Erste_Zahl.value / document.Formular.Zweite_Zahl.value;
document.Formular.Ausgabe1.value= Ergebnis;
if(Ergebnis>100){
document.Formular.Ausgabe2.value="Geht nicht";
}
}
</script>
<form name="Formular" action="">
<br>
<br>
    <input type="text" name="Erste_Zahl" size="4">
    <input type="text" name="Zweite_Zahl" size="4">
<br>
<br>
<button type="button"> <img src="images/mal.png" width="32" height="32" onclick="Mal()"> </button>
<button type="button"> <img src="images/plus.png" width="32" height="32" onclick="Plus()"> </button>
<button type="button"> <img src="images/minus.png" width="32" height="32" onclick="Minus()"> </button>
<button type="button"> <img src="images/geteilt.png" width="32" height="32" onclick="Geteilt()"> </button>
<br>
<br>
<br>
        <input type="text" name="Ausgabe1" value="Ergebnis" size="10">
</form>
</body>
Wo liegt denn der Fehler? .. Wenn ich was berechnen will, gibt er nichts aus.
(Bin ein Anfänger)