@emjogale
Posted
Hi Syazwan, I was interested in your solution as I had spent quite a lot of time on this challenge. Your solution looks great and is very close to the design sp[ecification. However, I think it would make things simpler if you specified the inputs as type="number", then you wouldn't have to have a function which checks if the input is a number. I also noticed that the error message doesn't appear if the number of people is 0 - I think this might be because you have put the event listener on the number of people section, whereas if you included the check within the function attached to the percentage buttons then it would activate it at the point of calculation. I hope this is of help! Happy Coding!
Marked as helpful