I have this following code: JS Fiddle
<html>
    <head>
        <script>            
            function increase(){
                var a = 1;
                var textBox = document.getElementById("text");
                textBox.value = a;
                a++;
            }            
        </script>
    </head>
    <body>
        <button type="button" onclick="increase()">show</button>
        <input type="text" id="text">
    </body>
</html>
What I am trying to do is:
Where am I going wrong?
<input type="text" id="text" value="1"/>
function increase(){
    var textBox = document.getElementById("text");
    textBox.value++;
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With