title: Change button onclick after first click
body: <p>I'm having some struggles getting this to work.
  I have a button, and I want it to execute Javascript function A, and in that function A, i want to change the Onclick to function B. Thus getting as result when the user taps the button a SECOND time, it's executing B. With the</p>
  
  <pre><code>&lt;Button onclick="A();"&gt;Click me&lt;/button&gt;
  &lt;script&gt;
  Function A() {
  document.getElementById("button").onclick=B();
  }
  Function B() {
  Alert("hello world");
  }
  </code></pre>
  
  <p>In function A(), it doesn't execute FIRST A and after that B, it instantly executes B. Could anyone help me? Thanks :)</p>