When I enter a credit card number, I want to automatically insert a space after every 4 digits. For example: 0000 0000 0000 0000 I am currently using vue js and have come across examples using jquery, but I prefer not to use jquery.
Any help would be appreciated
<!--template -->
<div>
<div>
<p>Card Number</p>
<input class="cardNumber" type="tel" name="cardNumber" placeholder="Enter your card number " maxlength="19" pattern="\d*"><i class="fas fa-credit-card"></i>
</div>
<div>
<p>Expiration Date</p>
<input type="tel" name="expiration" pattern="\d*" maxlength="7" placeholder="MM / YY">
</div>
<div>
<p>CVV</p>
<input type="tel" name="cvv" pattern="\d*" maxlength="4" placeholder="CVV">
</div>
</div>
<!-- /template -->