ichnicht
Mitglied
Hab folgenden Code geschrieben:
Meine Frage: Was hab ich falsch gemacht
thx for help
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>JavaScript-Beispiel</title>
<script type="text/javascript">
<!--
function pls()
{
var myObj = (IE)?document.all["res"]:document.getElementById("res");
var result = eval(document.form.frs.value + "+" + document.form.sec.value);
var outp = document.form.frs.value + " + " + document.form.sec.value + " = " + result;
myObj.innerHTML = outp;
}
//-->
</script>
</head>
<body>
<form name="form" action="">
1. Zahl: <input type="text" name="frs" size="3">
2. Zahl: <input type="text" name="sec" size="3">
<br><br>
<input type="button" value="+" onClick="pls()">
</form>
<br><br>
<span id="res"> </span>
</body>
</html>
Meine Frage: Was hab ich falsch gemacht
thx for help