I’m doing a Tip Calculator:
The problem is:
- I have the variable called “porcentaje” wich is gonna change depends of the button (10%btn, 15%btn, 20%), And, as you can see the code is repetitive.
How can is put this 3 events onclick (first, second and thridbtn) in the same line and say “if you press first the ‘porcentaje’ its gonna be 10%, second button, 15% and so on…”? It is that posible? i just want to make my code better! i wil love to read your opinion.
Thanks in advance!