I am attempting to learn HTML and Javascript, and with this, I am working on building a simple calculator device, where all of the numbers and operators are buttons that are clicked, and the results are displayed in an input box. However I have had issues with, when clicking on the buttons, having the events trigger to display the selected numbers value in the box.
Here is my HTML and JS:
var numString = "";
$('.number').click(function() {
numString += $(this).val().toString;
$('input[name=display]').val(numString);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input id="display" name="display" disabled></input>
<button id="button1" class="number" value="1">1</button>
toStringshould betoString()