4 Replies Latest reply on Jul 13, 2018 1:28 PM by jekaterina2

    HTML5 Javascript Button click triggers multiple times

    jekaterina2 Level 1

      There is a button when I click once, it increments the qtitlebuttonNo by one. But now out of no reason, it jumps from 1 to 3. But after 3 are all functioning well. Just don't know why when I click the first time, qtitlebuttonNo++; triggers twice so it increments by two from 1 to 3. What can I do to solve it? Thanks.



      game2f2 = this;

      game2f2.confirm_btn_qanswer.addEventListener("click", showNext_qanswer.bind(game2f2));


      var clickedOnce = false;

      function showNext_qanswer(){


      console.log("game2f2 qtitlebuttonNo",qtitlebuttonNo);


      if(qtitlebuttonNo<15) {




      else gameOver = true;




      clickedOnce = true;