Question: (JAVASCRIPT AND HTML) CALCULATOR I need help turning a string into a mathematical operation. I cannot use JS eval function. I was thinking about using
(JAVASCRIPT AND HTML)
CALCULATOR
I need help turning a string into a mathematical operation. I cannot use JS eval function. I was thinking about using .split("") to split the string into an array of numbers and maybe use parseInt to turn "numbers" into actual numbers... but I do not know how to execute this. Can someone help?

/p>
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
function display(num) {
var node = document.getElementById("display");
node.value+=num;
}
function result(op)
{
document.getElementById("display")=(document.getElementById("display").value).string("")
}
h1{
font-family: Arial;
color:#6495ED;
font-weight:normal;
font-size:150%;
padding-top:10px;
}
body {
text-align:center;
background-image: url("wall.jpg");
background-repeat:repeat-x;
}
.btn {
border: none;
outline: none;
padding: 10px 16px;
background-color: #CCFFFF;
cursor: pointer;
}
.active, .btn:hover {
background-color:#6495ED;
color: white;
}
.button input[type="button"]
{
font-size:170%;
padding:14px;
border-radius: 50%;
}
Simple calculator
src="http://www.w3.org/Icons/valid-xhtml11"
alt="Valid XHTML 1.1" height="31" width="88" />
Simple calculator 73 7 8 9 4 5 6* r XHTML
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
