kekc91,
Вариант простого калькулятора ...
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
for (var a = " |1|2|3|\u21d0|4|5|6|+|7|8|9|-|0|*|/|=".split("|"), c, b, i = 0; i < a.length; i++)
c = document.createElement("input"),
c.type = i > 0 ? (c.onclick = function () {rezultat(this.value)},"button") : (c.setAttribute("readonly","readonly"),"text"),
c.value = a[i], c.id = "n" + i,
document.body.appendChild(c),
i % 4 == 0 && document.body.appendChild(document.createElement("br"));
c = 0;
function rezultat(f) {
var d = document.getElementById("n0"),
e = d.value;
/\d/.test(f) && (d.value += f);
/\u21D0/.test(f) && (d.value = e.replace(/.$/, ""));
e = +e;
if (/[\*\+\-\/]/.test(f)) c = e, d.value = "", b = f;
if (/=/.test(f)&&e) switch (b) {
case "*":
d.value = c * e;
break;
case "+":
d.value = c + e;
break;
case "-":
d.value = c - e;
break;
case "/":
d.value = c / e
}
};
</script>
</body>
</html>