+ 1

Can someone explain what promt is in the code and its meaning?

// if-else if var age = prompt ("Please enter your age."); if (age <= 12) { document.write("You are a child."); } else if (age <= 18) { document.write("You are a teenager.") } else if (age > 18) { document.write("You are getting old.") } else { document.write("You did not enter an age.") }

19th Jul 2018, 8:11 AM
Frans
1 Odpowiedź
+ 2
prompt asks for an input. It 'promts' you for input.
19th Jul 2018, 8:15 AM
Satyam