JS prompt - calculator (калькулятор) 2 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

JS prompt - calculator (калькулятор) 2

Please help me Refine the calculator. When you enter letters, you need to ask them to enter again until you enter a number. Прошу помощи в доработке калькулятора. Нужно чтобы при вводе букв предлагать еще раз ввести, пока не введете цифру.

20th Nov 2020, 1:05 PM
Марина Гординская
Марина Гординская - avatar
3 Answers
20th Nov 2020, 1:08 PM
Марина Гординская
Марина Гординская - avatar
+ 1
Why not use <input type="number"> for the width, length and height? once the button is clicked you validate the three values and proceed when all is OK. Running a loop asking for input over and over again can be annoying. (Edit) Please use the tags properly, you can put code link in Description and use the tags to specify a language name instead 👍
20th Nov 2020, 1:18 PM
Ipang
+ 1
Thanks, I'll try it now.
20th Nov 2020, 1:30 PM
Марина Гординская
Марина Гординская - avatar