I have a jQuery Credit Card Plugin and when you enter the credit card number it switches out a class that shows an image for the credit card entered.
How to I clear the credit card each time for the new one to appear?
<div> <form> <div id="ccc" class="form-group add-on"> <label for="ccnumber">Credit card Number</label> <input type="text" class="form-control" id="credit-card" placeholder="Credit Card Number"> </div> </form> <div id="output"></div> <div id="c-card-type"></div> </div> JS
if(cardType == null){ return; }else{ switch(cardType.name){ case 'visa': $('#output').html('This Card is visa'); $('#c-card-type').toggleClass('c-card vs'); break; case 'mastercard': $('#output').html('This Card is mastercard'); $('#c-card-type').toggleClass('c-card mc'); break; case 'ax': $('#output').html('This Card is ax'); $('#c-card-type').toggleClass('c-card ax'); break; default: $('#output').html('We dont support ' + cardType.name); } }