Skip to content
  • Learning paths
  • Challenges
  • Solutions
  • Articles
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted almost 4 years ago

tip calculator HTML,CSS,JS

Azzy dvyastia kesuma•1,425
@azzykesuma
A solution to the Tip calculator app challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


any feedback will be appreciated!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Supa•80
    @SupaSibs
    Posted over 3 years ago

    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•555
    @HYDROCODER
    Posted almost 4 years ago

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

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
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub