Form calculate with integer javascript : <p>I want the user to insert a number e.g. 10 and make the calculation var newbalance + balance + 2, but the output of this code would be 102 and not 12. I think my script thinks the var balance is not an integer but a word or something. how can I fix this</p>

<pre><code>&lt;form id="form" oninput="checkChange()" onchange="checkChange()"&gt;
                            &lt;div class="container100 t-center" style="font-size:0;"&gt;
                                &lt;div class="container20 t-center"&gt;
                                &lt;/div&gt;
                                &lt;div class="container60 t-center"&gt;
                                    &lt;div class="container60 t-center" style="font-size:0;"&gt;                                                 
                                        &lt;div class="container60 t-center"&gt;
                                            Balance
                                            &lt;input name="balance" type="text" style="width:90%;" placeholder='balance'&gt;
                                            &lt;input type="text" id="mytext"&gt;
                                        &lt;/div&gt;
                                    &lt;/div&gt;&lt;br&gt;&lt;br&gt;                                  
                                &lt;/div&gt;
                                &lt;div class="container20 t-center"&gt;
                                &lt;/div&gt;
                            &lt;/div&gt;                              
                        &lt;/form&gt;&lt;br&gt;                                 
                        &lt;button id="submit" class="button" onclick="command()"&gt;Submit&lt;/button&gt;&lt;br&gt;&lt;br&gt;
                        &lt;script&gt;
                            document.getElementById('submit').onclick = command;    
                            var submitButton = document.getElementById('submit');
                            submitButton.onclick = command;

                            function command() {
                               event.preventDefault();
                               submitButton.style.background = 'rgba(92,184,92,1)';
                            }

                            function checkChange(){ 
                              submitButton.style.background = 'rgba(90,90,90,1.0)';
                            }                                       
                            function command(){
                                var x = document.getElementById("form");
                                var balance = x.elements["balance"].value;

                                var newbalance = balance + 2;
                                document.getElementById("mytext").value = newbalance;
                            }
                        &lt;/script&gt; 
</code></pre>
