使用Javascript显示多个提示框的结果

使用Javascript显示多个提示框的结果,javascript,Javascript,如何创建多个提示框并按字母顺序对其输入进行排序,然后使用JavaScript在屏幕上显示 谢谢 如果您谈论的是几乎过时的本机javascrtipt函数提示符,那么: 演示 欢迎来到stackoverflow。你做了什么努力?对我来说,这是家庭作业。你的问题不清楚。试试:循环、数组、DOM var array=[];questions=['A?','B?','C?'],current=0; function q(question){ array.push(prompt(question,'wri

如何创建多个提示框并按字母顺序对其输入进行排序,然后使用JavaScript在屏幕上显示

谢谢

如果您谈论的是几乎过时的本机javascrtipt函数提示符,那么:

演示


欢迎来到stackoverflow。你做了什么努力?对我来说,这是家庭作业。你的问题不清楚。试试:循环、数组、DOM
var array=[];questions=['A?','B?','C?'],current=0;
function q(question){
 array.push(prompt(question,'write here')+' question number:'+current);
 if(current<questions.length){
  next()
 }else{
  array.sort()// needs a proper sort function
  alert(array.join("\n"));
 };
}
function next(){
 q(questions[current++]);
}
next();