Hello I have written a simple html/javascript calculator.
Whenever I make a calculation, it is added to the list displayed on the html.
What I need: When a list item is clicked I need the string of that calculation, 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>