Hi all,
I am trying to create yet another calculator, however I have put together what I have on my own, and have hit a wall. No doubt its silly but I am stumped with a headache. I have “or at least I thought I have created the flow of logic.”
I will not move on until I get the first one to work. ?
Can you give me a push.
[CODE]
<script type=”text/javascript”>
//declare variables
var x;
var y;
//retrieve variables from input boxes input1 and input2 and send to functions.
x = document.getElementById(“input1”).value;
y = document.getElementById(“input2″).value;
//add both input1 and input2 together and send to result.
//display result.
functionAdd()
{
result = x + y;
return result;
}
</script>
</head>
<body>
<label>Number 1 </label>
<input type=”text” name=”x” id=”input1″ />
<label>Number 2 </label>
<input type=”text” name=”y” id=”input2″ />
<form id=”form1″ name=”form1″ method=”post” action=””>
<label>
<input type=”button” name=”+” id=”+” value=”+” onclick=”functionAdd()” />
<input type=”button” name=”-” id=”-” value=”-” />
<input type=”button” name=”/” id=”/” value=”/” />
<input type=”button” name=”*” id=”*” value=”*” />
</label>
<p>
<label>Result</label>
<input type=”text” name=”result” id=”result” />
</p>
</form>