Cash Register Project


I’m building the cash register project and am trying to create a function that will update the cash available in the cash register in the UI. However, I can’t figure out how I can change the p elements using js to display the current amount of pennies, nickels, quarters…etc

Could someone give me a hint or point me in the right direction?

Project Link

Thanks in advance.

  <p>Pennies:</p> <p id="count1"></p> 
  <p>Nickels:</p> <p id="count2"></p> 

Then in your javascript, pre-compute the quantity of coins you have. Then, queryselector it and update its innerText.

1 Like

I actually nested span elements inside the p elements and gave them ids, but you gave me the idea. Thank you!