Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

tip calculator HTML,CSS,JS

@azzykesuma

Desktop design screenshot for the Tip calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


any feedback will be appreciated!

Community feedback

Supa 80

@SupaSibs

Posted

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.

0
HYDROCODER 555

@HYDROCODER

Posted

Hey there! Good job. There are some things I would suggest here if you don't mind:

  1. 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.

  2. You have some accessibility issues. I would suggest to go through articles on semantic HTML if you wish to correct them.

  3. 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; }

  4. 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 :).

0

@azzykesuma

Posted

@HYDROCODER yeah i keep getting accessibility issues with my HTML but i don't understand where i get it wrong, and as for the fourth suggestion, i do look up to the design and i think the 15% value is the default value since it in clicked state, but perhaps i am wrong though, thanks!

0

Please log in to post a comment

Log in with GitHub
Discord logo

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