Submitted 5 months ago
interactive card details using tailwindCSS and javascript
@Godbrand0
Design comparison
SolutionDesign
Solution retrospective
What are you most proud of, and what would you do differently next time?
i am most proud of my use of javascript in making the cards interactive,and making sure it is as close to the design as possible.
What challenges did you encounter, and how did you overcome them?it took a while to write the code to add a space after every 4th digit, i don't understand it fully yet but i will learn
What specific areas of your project would you like help with?function formatCardNumber(value) { const formattedValue = value.replace(/(.{4})/g, "$1 "); return formattedValue.trim(); } function changeNumber() { const formattedNumber = formatCardNumber(cardNumber.value); cardNumber.value = formattedNumber;
if ( formattedNumber.replace(/\s/g, "") !== "" && !alphabet.test(cardNumber.value) ) {
Community feedback
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord