Kaustubh Maladkar• 230
@KaustubhMaladkar
Posted
Nice work! I just have some suggestions on how this could be done better-
- According to the design, you had to remove the counter from the number inputs
- You can performs checks to see that the output you get is not NaN, so that you only display a valid answer
- You were supposed to use a "calculate" button, which would be disabled until the user inputs were found to be appropriate
- Inputs with inappropriate values (including bill amount), would have looked better with a red border, and appropriate ones with a green border
Accessibility issues (Check your accessibility report for more information):
- Always add a "for" attribute for label elements, matching with id of the input the label is bound to
- Never have attributes with the value of empty string
Code structure:
- Try and use callback functions in event calls instead of declaring functions outside and calling them when an event is fired
- Give functions better names, instead of "peopleInputFun". It took me a while to understand what it meant
- Use Intl.NumberFormat, instead of appending dollar manually
- Try to incorporate ES6 syntax in your code(arrow functions, template literals, etc.)
Don't be discouraged you did a pretty fine job! You can checkout my solution at: https://github.com/KaustubhMaladkar/Tip-Calculator
Marked as helpful
0