Rewrite javascript variable value on button click
<p>I am new to javascript, I have been working with Java for some time, I made a simple game and i found out it could be a lot better in JS. So I started learning and now I am facing a problem:
When I press a button to increase an int variable it does nothing.
Here is my code:</p>

<pre><code>  &lt;script&gt;

    var a=5;

     void function increaseA(){
      a+=1;
     }

    document.write("Value of A is"+a+"&lt;br&gt;");

&lt;/script&gt;

   &lt;button onclick="increaseA()" &gt;Increase A&lt;/button&gt;
</code></pre>

<p>the button should actually increase variable a and of course the contain in document.write should change. </p>

<p>Can you help me please? </p>