title: Comparing data of two textboxes is not working using jquery
body: <p>I want to compare the data of two text boxes using jquery like as we compare the password and confirm password while making an email account. Still i have the following stuff.</p>
  
  <p><strong>CSS</strong></p>
  
  <pre><code>.test {
      display:none;
  }
  </code></pre>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;input type="text" name="t1" /&gt;
  &lt;input type="text" name="t2" /&gt;
  &lt;label class="test" name="lblerror"&gt;Error&lt;/label&gt;
  </code></pre>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>$("#t2").click(function () {
      if ($("#t1").val() === $("#t2").val()) {} else {
          $("#lblerror").removeClass("test");
      }
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/MtPeZ/" rel="nofollow"><strong>DEMO</strong></a></p>
  
  <p>Please help me, how can i compare these two strings while just leaving the second text box named <code>t2</code>.</p>
  
  <p>Thanks in advance.</p>