I want to do a test task and I want it to look like this: How much is 2 + 2?

There will be a field for entering numbers.

There will be a button with the inscription "Answer" and if the number 4 is entered in the field, then a window should appear with the text correctly, and if not 4, and any other with the inscription wrong.

  • And where are you planning to get examples from? Are there many or a few such examples? field in popup window or just input'e? - Zowie

1 answer 1

var data = prompt("Сколько будет 2 + 2 ?"); if(parseInt(data) == 4){ alert('Правильно!'); } else { alert('Не павильно, иди учись, бестолочь'); } 
  • Well, if it's stupid for 2 + 2, then that's all, it just seems to me that the idea of ​​the TSA is not so simple, I could be wrong of course ... - Zowie
  • 3
    What question is this and the answer;) - metazet