I pasted my work so far that works function doAdd var a pa
I pasted my work so far that works.
<html>
<head>
<script>
function doAdd() {
var a = parseInt(document.getElementById(\'box1\').value);
var b = parseInt(document.getElementById(\'box2\').value);
var c = a + b;
document.getElementById(\'box3\').value = c;
}
function doSub() {
var a = parseInt(document.getElementById(\'box1\').value);
var b = parseInt(document.getElementById(\'box2\').value);
var d = a - b;
document.getElementById(\'box3\').value = d;
}
function doMultiply() {
var a = parseInt(document.getElementById(\'box1\').value);
var b = parseInt(document.getElementById(\'box2\').value);
var e = (a*b);
document.getElementById(\'box3\').value = e;
}
function doDiv() {
var a = parseInt(document.getElementById(\'box1\').value);
var b = parseInt(document.getElementById(\'box2\').value);
var f = (a/b);
document.getElementById(\'box3\').value = f; }
</script>
</head>
<body>
<input type = \"text\" id = \'box1\'>
<br>
<input type = \"text\" id = \'box2\'>
<button onClick=\"doAdd()\">+</button>
<button onClick=\"doSub()\">-</button>
<button onClick=\"doMultiply()\">*</button>
<button onClick=\"doDiv()\">/</button>
<button onClick = \"doClear()\">Clear</button>
<br>
<input type = \"text\" id = \'box3\'>
</body>
</html>
ClearSolution
<html>
<head>
<script>
function doAdd() {
var a = parseInt(document.getElementById(\'box1\').value);
var b = parseInt(document.getElementById(\'box2\').value);
var c = a + b;
document.getElementById(\'box3\').value = c;
}
function doSub() {
var a = parseInt(document.getElementById(\'box1\').value);
var b = parseInt(document.getElementById(\'box2\').value);
var d = a - b;
document.getElementById(\'box3\').value = d;
}
function doMultiply() {
var a = parseInt(document.getElementById(\'box1\').value);
var b = parseInt(document.getElementById(\'box2\').value);
var e = (a*b);
document.getElementById(\'box3\').value = e;
}
function doDiv() {
var a = parseInt(document.getElementById(\'box1\').value);
var b = parseInt(document.getElementById(\'box2\').value);
var f = (a/b);
document.getElementById(\'box3\').value = f;
}
function doPow() {
var a = parseInt(document.getElementById(\'box1\').value);
var b = parseInt(document.getElementById(\'box2\').value);
var f = 1;
for(i=0;i<b;i++)
{
f=f*a;
}
document.getElementById(\'box3\').value = f;
}
function doClear() {
document.getElementById(\'box1\').value=\" \";
document.getElementById(\'box2\').value=\" \";
document.getElementById(\'box3\').value = \" \";
}
</script>
</head>
<body>
<input type = \"text\" id = \'box1\'>
<br>
<input type = \"text\" id = \'box2\'>
<button onClick=\"doAdd()\">+</button>
<button onClick=\"doSub()\">-</button>
<button onClick=\"doMultiply()\">*</button>
<button onClick=\"doDiv()\">/</button>
<button onClick=\"doPow()\">^</button>
<button onClick = \"doClear()\">Clear</button>
<br>
<input type = \"text\" id = \'box3\'>
</body>
</html>

