title: Why this jquery doesnt works?
body: <p>check this fiddle <a href="http://jsfiddle.net/KaDy8/7/" rel="nofollow">http://jsfiddle.net/KaDy8/7/</a> .
  this is my jquery code</p>
  
  <pre><code>jQuery(document).ready(function(){
  $('input[name="cardnumber"]').on('keyup',function(){
     var cc_num = $('input[name="cardnumber"]').val();
     if(cc_num.charAt(0)=='4'){
      $('#visa').addClass("active");
      $('#mastercard ').removeClass("active");
     }else if(cc_num.charAt(0)=='5'){
      $('#mastercard').addClass("active");
      $('#visa').removeClass("active");
     }
  });
  });
  </code></pre>
  
  <p>When I enter 4,the active class should be added to the ul element visa,and when i type 5 active class should be added to ul element mastercard.It is working when I enter 5 into the field ,the card is getting changed,that is it is adding the class to ul element mastercard,but from there if I enter 4,its not adding back the class to ul element visa.What could be the problem?</p>