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.
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.
Here is very simple demo. http://jsfiddle.net/6HmxM/653/
$( "input" )
.keyup(function() {
if ($( "input" ).val() == 45) {
var val = "Visa";
}
$( "p" ).text( val )
})
switchorif..else ifset of functions. I like this idea of the image appearing and disappearing with input.4567don't happen at the first of the string rather later on.