title: javascript/jquery changing html element based on value entered into text input field
body: <p>It sounds simple but I am a novice with Javascript and I am having a very tough time trying to find / create this script. I have a list of BIN numbers for credit cards and am trying to grab the first 6 digits of the card number field and check to see what kind of card it is, then displaying the appropriate card logo on screen based on the BIN entered.</p>
  
  <p>I have been able to create a very simple script which checks the input and can change a value or element, but I have not figured out how to do the reverse. I need to be able to remove the card logo and replace it if the user deletes the card and re-enters the card info.</p>
  
  <p>Here is very simple demo.
  <a href="http://jsfiddle.net/6HmxM/653/" rel="nofollow">http://jsfiddle.net/6HmxM/653/</a></p>
  
  <pre><code>$( "input" )
  
    .keyup(function() {
    if ($( "input" ).val() == 45) {
        var val = "Visa";
    } 
    $( "p" ).text( val )
  })
  </code></pre>