title: Javascript: comparing two values always not equal
body: <p>I'm trying to do something but im struggling with a stupid bug, hope you can help me.</p>
  
  <p>As you can see in my code I have on server some check box and I attached to it a JavaScript function. This function gets two values (current value and original value).
  My problem is when this function triggers on the <code>if</code> it always get to the first clause and never reach the else clause and it doesn't make any sense.</p>
  
  <p>When I used few alerts in my code this is what happens:</p>
  
  <p>case 1: <strong>alert #1</strong>  original: <code>false</code> current: true <strong>alert #2</strong>  <code>true</code></p>
  
  <p>case 2: <strong>alert #1</strong>  original: <code>false</code> current: false <strong>alert #2</strong>  <code>true</code></p>
  
  <p>As you can see, no matter what I get true on the 2nd alert.</p>
  
  <p>Hope I managed to explain my problem.</p>
  
  <pre><code>&lt;asp:CheckBox id="chkIsCustomQuantity" originalvalue="false" runat="server" onclick="checkChange(this.checked, this.attributes['originalvalue'].value" /&gt;
  
  &lt;script type="text/javascript" language="javascript"&gt;
      function checkChange(value, originalValue) {
  
          //i added this for debugging purpose
          alert('original: ' + originalValue + ' ' + 'current: ' + value);
          alert(value != originalValue);
  
          if (value != originalValue) {
               // always happens
          }
          else {
                // never happens
          }
      }
  
  &lt;/script&gt;
  </code></pre>