Hallo, wir sollten für unseren Kurs einen Taschenrechner auf unserer Webseite erstellen. Diese sollte erst + - * und / errechnen können. Dies habe ich so gemacht:
<form name="Rechner">
<table border="10" cellpadding="10" bgcolor="#E0E0E0">
<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>
<td width="50"><input type="button" value="Wurzel " 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>
Jetzt sollen wir den Taschenrechner erweitern und Flächeninhalt; Umfang(Rechteck),Potenzieren,Fakultät, Modulo und Dezimal Dual hinzufügen.
Die Buttons kann ich erstellen, aber wie erstelle ich die dazugehörige scripts? Ich hoffe jemand kann mir helfen. :(