I have No idea of how to show the errors and how it should look like so I just made conditions to show the result only if the user types valid numbers ... waiting for feedback or help or bug hunter xD
Vishav Ranta
@rantavishavAll comments
- @CH4R4FSubmitted over 3 years ago@rantavishavPosted over 3 years ago
Hi, I am also New For coding World and tried out couple of challenges from this site. My first challenge was also this one. So I can give you a tip how I implemented Error messages.
So basically I first set the error message in html file and give it desired css, at this time error message should be visible as suggested in the design. After that you make that error message element visibility : hidden. So whenever user Put the wrong input through JS You will check if input is correct or not, if not just make that style visibility: visible. This is old school trick but love it.
Also You want to show result (tip/Amount and Amount/Person) as default values whenever user Put wrong input.
Also your Reset Button didn't reset the tip % style back to default.
Hope it helped. And yes it was very impressive :)
2