Here I give card number as value. But on load, the input doesn't take the class name as card name and when change the value on input focusing the input field has triggered corresponding class name. I have fixed the issue with some custom codes that given below;
//get card type on load
$('.cc-number-saved').each(function() {
var cardType = $.payment.cardType($(this).val());
$(this).addClass(cardType);
});
Any other solution to get input class name on page load?
How I get input class [card type class name] on prefilled field. Check below codes
<input class="text-field cc-number-saved" type="tel" autocomplete="off" value="5252-5555-5555-5555">
Here I give card number as value. But on load, the input doesn't take the class name as card name and when change the value on input focusing the input field has triggered corresponding class name. I have fixed the issue with some custom codes that given below;
Any other solution to get input class name on page load?