Hey there, I've created a basic HTML/JavaScript calculator.
Each time I perform a calculation, it gets added to the list shown on the webpage.
Here's what I'm looking for: When a user clicks on an item in the list, I want to retrieve the string of that operation so I can reload the values back into operand 1 and operand 2.
<html>
<head>
</head>
<body>
<h1>Calculator With Buttons And History</h1>
<table>
<tbody>
<tr>
<td><label>Operand 1:</label></td>
<td><input id="o1" type="text" /></td>
</tr>
<tr>
<td><label>Operand 2:</label></td>
<td><input id="o2" type="text" /></td>
</tr>
</tbody>
</table>
<p><button onclick="add()"> + </button> <button onclick="sub()"> - </button> <button onclick="mul()"> x </button> <button onclick="div()"> / </button></p>
<p>Result:<input id="result" name="result" readonly="readonly" type="text" value="" /></p>
<ul id="result_list" class="list-group" onclick="getCalc(this)">
<li class="list-group-item">1+1=2</li>
<li class="list-group-item">1-1=0</li>
<li class="list-group-item">2*2=4</li>
<li class="list-group-item">3/3=1</li>
</ul>
<script src="filter.js"> </script>
<script src="calc.js"> </script>
</body>
</html>