Creating a simple calculator
This is for a blog post: JavaScript Calculators & Code Creators
by David Roman-Halliday
HTML
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Calculator Example</title>
<!-- Note: for inline javascript, the code will go here -->
<!-- Note: for jsfiddle.net, the code will go in the JavaScript frame -->
</head>
<body>
<h1>Calculator Example</h1>
<p>
<label for="input_a">Input A: </label>
<input name="input_a" type="number" value="100">
<br/>
<label for="input_b">Input B: </label>
<input name="input_b" type="number" value="5">
</p>
<p>
<input id="runButton" type="button" name="run" value="Run Calculations">
</p>
<p id="output">
Output will be here
</p>
</body>
</html>