title: After second triggered function button inside execute code twice
body: <p>I make a game and I have problem that I cant solve.
  I have function and inside I have buttons with .click(). After I execute function for second time buttons clicks execute code twice for example I post here some simple code with same problem. </p>
  
  <p>When I click 1st button alert is triggered once. When I click 2nd and then 1st button alert is triggered twice. I want trigger alert just once. Buttons must stay in function. Sorry for bad English.</p>
  
  <p>Also jsfiddle here <a href="https://jsfiddle.net/o2gxgz9r/25237/" rel="nofollow noreferrer">https://jsfiddle.net/o2gxgz9r/25237/</a></p>
  
  <pre><code>function testf() {
    $("#1").click(function() {
      alert("test");
    });
  
    $("#2").click(function() {
      testf();
     });
  }
  
  testf();
  </code></pre>