I try to make a calculator with javascript with the onclick event I want the value of the button to convert an input text box. When I write the code the value of the button briefly in the text box , but it disappears instantly.
The code that i use can you find below this text, what am i doing wrong.
HTML:
var iGetal = 0; function GetalRekenmachine() { iGetal = iGetal + 1; document.getElementById("Display").value = iGetal; } <button id="Cijfer7" value="7" onclick="GetalRekenmachine()">7</button> <input type="text" id="Display"/>