Design comparison
Solution retrospective
i got a bug in radio button. Function in JS is fastest than Even of css to give checked attribute to radio button whenever user click the radio. as you can see, i put an Even onclick in the label of radio to clear the Input Custom and recalculate the tip amount at the same time. But somehow it is always get the last checked radio value, even the radio already checked with the newest. to overcome this issue, i use setTime 500ms to wait the css finished giving checked attribute to the selected radio. and afeter 500ms Js will run the calculate function. and it works!
i know it is not the best way, so if you know the best way to solve this, just let me know! i appreciate for your advice guys!
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