+ 2

When is the second parameter of prompt useful in which cases can we use it?

22nd Apr 2019, 11:05 AM
Rucha
Rucha - avatar
3 ответов
+ 1
Second parameter in prompt mostly comes up as a placeholder like in HTML input tag!
22nd Apr 2019, 7:17 PM
Azizbek Khalilov
Azizbek Khalilov - avatar
+ 1
Yeah but placeholder remains in background while the text in this case stays and we have to erase it to write anything...
23rd Apr 2019, 9:45 AM
Rucha
Rucha - avatar
0
the second parament can be an empty string like this ex. prompt("how are you today?", " "); because some browsers will put undefined if no second parameter is defined
6th Aug 2019, 2:04 PM
kay cruz
kay cruz - avatar