Design comparison
Solution retrospective
I was wondering if there is a simple way of auto-formatting the card number input from users without using frameworks (i.e. auto-spacing 4-digit numbers)
Community feedback
- @james-rodPosted about 1 year ago
Hello, here a tip,
You should add an input event listeners as it is an effective way to achieve this as well as a combination with the innerHTML property to update the content of card containers. The input event listener on the button triggers the update of the card container's content when the button is clicked. The innerHTML property is used to replace the existing content with the new content generated from the user's input and dynamic numbers.
0
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