Skip to content
Advertisement

JavaScript Onkeyup expiry date

How can i set onkeyup to output this format 00/00 instead 00/00/0000

JavaScript

Advertisement

Answer

You could add maxlength="5"

JavaScript

I also improved your regex to use replace and remove the / automatically

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement