Need help with a Javascript project - It doesn't work!

I have built a tip calculator on Codepen. It looks like I did everything right, but it doesn’t work! I even checked it against other tip calculators on Codepen. I have reviewed the Javascript and HTML a million times and I need a fresh set of eyes. Would you please take a look and give me an idea where the bug is? Here is the link:

Thank you!

You have to type lowercase ‘g’ instead of uppercase ‘G’ in getElementById.

  let billAmt = document.GetElementById("billInput").value;
  let servQual = document.GetElementbyId("qualitySelector").value;
  let numPeople = document.GetElementById("totalPeople").value;
1 Like

I found some typos and misconceptions in your code. I fixed it and commented here:

You have a lot typos with document.getElementById. Some cases the ‘g’ is capitalized some cases the ‘b’ isn’t capitalized.

Also, servQual = 0 should be servQual == 0 since you are comparing their values, not assigning it.

By the way, something you can do to figure out what to fix is to bring up the console, it’ll tell you what errors are happening so you can fix your code.

Thank you all very much for your help!