Design comparison
Solution retrospective
This took me a lot of time on styling rather than adding the logic. However, it was very fun! If you have any suggestions for me to improve my code, feel free to leave them below. Thanks.
Community feedback
- @warrenleePosted over 2 years ago
Hi Ly Dinh Minh Man, good effort on this challenge and also good effort in using vanilla JS. I think to take your coding to the next level you could try learning Vue/React JS framework which would take the tedious coding from vanilla, for example mapping the values from the input fields to text in an element.
In vanilla you would add an event listener to the input, extract the value, find the mapping element and assign the value as text into the element. With Vue/React however it probably just takes one like code to be as simple as
cardNumberTextElement = cardNumberInputValue
or a little more advanced, you can use shared states where states are used in both components such that one variable is shared between the text element and input.Feel free to check out my solution on this for inspiration/tips!
1
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