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 app

Khadija Rejjaouiโ€ข 220

@Khadijarejjaoui99

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


Hello friends, I did this challenge using HTML, CSS, & JS. I am looking forward to hear your feedback. I appreciate your time :) Thank you!

Community feedback

Kelvinโ€ข 915

@Kl3va

Posted

Hi Khadija. A little observation; As my bill increases, it breaks the user interface. Seeing this is a small application, you can try to limit the character length of the bill or make value of the bill total to scroll horizontally within itโ€™s width.

Marked as helpful

0

Khadija Rejjaouiโ€ข 220

@Khadijarejjaoui99

Posted

@Kl3va Thanks a lot!

1
Nahid Farajiโ€ข 150

@Nahid570

Posted

could you please explain "percentage = parseInt(item.innerHTML.slice(0, item.innerHTML.length - 1));" how this line works when I am calculating percentage? by the way, you did a great job.

0

Khadija Rejjaouiโ€ข 220

@Khadijarejjaoui99

Posted

@Nahid570 Hello, thank you so much for your comment. Using this line I am getting the text inside the button, but only a part of it. And this by using the slice method, that extract a part of a string. For example if the text inside the button is 15%, I want only to get 15. That's why I started the slice at index 0 and I ended it at length-1 which is exclusive. To know more about slice you can check this link: https://www.w3schools.com/jsref/jsref_slice_string.asp And by using parseInt I convert it from a string to an integer.

I hope that I explained it well. If not please let me know so that I can try to clarify it more.

0
Nahid Farajiโ€ข 150

@Nahid570

Posted

@Khadijarejjaoui99 Thank you so much for you valuable info. I understand this, from here I get all the button values how all this values works later I didn't understand. If you don't mind can I ask you something?

0
Khadija Rejjaouiโ€ข 220

@Khadijarejjaoui99

Posted

@Nahid570 sure, go ahead

0
Nahid Farajiโ€ข 150

@Nahid570

Posted

@Khadijarejjaoui99 I am sorry for asking that, you don't even know me. It seems like you also started Frontend mentor not so long. Can we collaborate?

0
Khadija Rejjaouiโ€ข 220

@Khadijarejjaoui99

Posted

@Nahid570 Yes, I am kind of new here. Currently I collaborate only with my collegemates, because I don't have that much time. If I get some extra time I will let you know so that we can collaborate. Thank you so much for your understanding!

0
Nahid Farajiโ€ข 150

@Nahid570

Posted

@Khadijarejjaoui99 Yeah sure, Thank you so much!

1

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