title: Displaying button using jquery when two values are equal
body: <p>I have been trying to pass the parameter from function calculateSumc1 to calculateSumc2. And when both the values of sum and sum1 are equal it should display the show button. Even if the sum is equal , the save button is not being displayed. </p>
  
  <pre><code>&lt;input type="button" class="btn btn-primary" id="save" style="display:none" value="Save" /&gt;
  
  
  $(".c1").click(function ()
      {
          $(this).keyup(function ()
          {
              calculateSumc1();
          });
      });
  $(".c2").click(function ()
  {
      $(this).keyup(function ()
      {
          calculateSumc2();
      });
  });
  
  function calculateSumc1()
  {
      var sum = 0;
      $(".c1").each(function ()
      {
          if (!isNaN(this.value) &amp;&amp; this.value.length !== 0)
          {
              sum += parseFloat(this.value);
          }
      });
      $("#debit").html(sum);
      //calculatetotal(sum);
      calculateSumc2(sum);
  }
  
  function calculateSumc2(sum)
  {
      var sum1 = 0;
      $(".c2").each(function ()
      {
          if (!isNaN(this.value) &amp;&amp; this.value.length !== 0)
          {
              sum1 += parseFloat(this.value);
          }
      });
      $("#credit").html(sum1);
      console.log("sum1" + sum1);
      while (sum == sum1)
      {
          $("#save").show();
      }
  }
  </code></pre>