tip calculator HTML,CSS,JS

Solution retrospective
any feedback will be appreciated!
Please log in to post a comment
Log in with GitHubCommunity feedback
- @SupaSibs
just some feedback, take this with a grain of salt as i didn't even complete this challenge, but you can use :focus and save lines in js instead of doing an if statement to add classes, also I'm pretty sure event doesent have to be an argument for it to work. so for handleClick something like tipval = parseFloat(event.target.innerHTML), and for calculating the percentage I would divide by one hundred in that function to avoid confusion.
- @HYDROCODER
Hey there! Good job. There are some things I would suggest here if you don't mind:
-
Do put some comments in your code. It will be helpful to others as well as for yourself if you ever need to look at it again.
-
You have some accessibility issues. I would suggest to go through articles on semantic HTML if you wish to correct them.
-
You can remove the arrow buttons in your bill and no. of people input fields using the following code:
/* Chrome, Safari, Edge, Opera */ input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } /* Firefox */ input[type="number"] { -moz-appearance: textfield; }
-
You have put a default tip percent of 15% and a default number of people. I would suggest you to remove that by making changes in your js code.
Hope it helps :).
-
Join 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