Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

TIP CALCULATOR

Vani 160

@VANIMEHTA

Desktop design screenshot for the Tip calculator app coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


1)Can somebody pls tell how do I put the dollar-sign and user img in my button placeholder. 2)Also my java script is not working fine,it would be great if u suggest changes.

Community feedback

@ereljapco

Posted

Hello!

  • You can wrap the dollar sign and the input element in a container. And add styles to it :)
<div class="bill__input-container">
  <p class="bill__dollar-sign">$
<input class="bill__input" />
</div>
  • You're currently using tipchoosen, which is a nodelist, to get the value of the button clicked. tipchoosen.value returns undefined. Instead, use the event.target to get the value.

Some things I noticed that you could look into:

  • 50% tip button's value was set to 0.25
  • NaN is appearing when billVal is empty. You can add an if condition so you can set a value to billVal if it becomes empty.

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord