title: Click function into click function
body: <p>I thought that if I put one click function into click function it was only proceeding the second click function if it was clicked, but when I click the first the codes for second one is running... I thought that if i clicked the second one it should have run the codes. 
  I mean when I clicked the second one then the codes are visible and doing as they should do, but If click like first function 3 times without to click the second and suddenly click on the second, it is behaving like the codes have run three times. </p>
  
  <pre><code>$(".click1").click(function () {
      alert("hej");
      $(".click2").
      function ({
          alert("bye");
      });
  });
  </code></pre>
  
  <p>My intention is to only make the second click to run when it is really clicked and not run the codes if I click the first one! </p>
  
  <p>To be more clear. When I click first, it says hej and if I click three time then it will say hej 3x but when I suddenly click click2 it showing bye three times but I only clicked once.</p>
  
  <p>Can anyone explain me why this is happening? and How i can prevent this to happen?</p>
  
  <p>Thanks for the help!</p>
  
  <p>EDIT!! </p>
  
  <pre><code>function click_back() {
  
          current_question_for_answer.splice(0,1);
          $("#tillbaka_question").fadeTo("slow", 0.2);
          $("#tillbaka_question").off("click");
          $(".questions").hide();
          $(".containing_boxes").show();
  
          $(".answered_box").remove();
  
          var numbers_of_answered_question = history.length - 1;
          for (var i = numbers_of_answered_question; i &gt; -1; i--) { 
              current_question.push(i);
              $(".containing_boxes").prepend('&lt;div class="answered_box"&gt;'+i+'&lt;/div&gt;');
              $("div.containing_boxes &gt; div:nth-child("+history.length+")").css("background-color", "green");
              $(".containing_boxes").hide();
              $(".containing_boxes").fadeIn(100);
          }
  
          $("div.containing_boxes &gt; div").not(":last-child").click(answered_box);
          $("div.containing_boxes &gt; div:nth-child("+history.length+")").click(function () {
  </code></pre>
  
  <p>$("div.containing_boxes > div:nth-child("+history.length+")").click(function () { }) this function should only work if I click it. I can not seperate this code in two new function. If I do it, then the whole system will stop working.....</p>