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
- @ereljapcoPosted over 2 years ago
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
returnsundefined
. Instead, use theevent.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 whenbillVal
is empty. You can add anif
condition so you can set a value to billVal if it becomes empty.
Marked as helpful0
Please log in to post a comment
Log in with GitHubJoin 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