I am making a calculator just for fun to learn about Javascript (I know HTML & CSS very well)and I have the basis of the calculator made. I wanted to make it so that you just use the buttons. The buttons work and all. But for example if I wanted to insert 11, that wouldn't be possible because I can only insert single digits and I don't know why :( Here is the button you press to insert the number 1.
<button type="button" onclick="no1 ()">1</button>
This is the javascript to insert he number 1 into the input tag:
var currentinput= document.getElementById("firstnumber");
var answer= document.getElementById("answer");
function no1 ()
{
currentinput.value=1;
answer.value=1;
}
How would I able to insert 11 instead of just 1?