var word = prompt("请输入一段文字",""); if(word){ //输出word的格式 alert("已获得:"+word); }
点击 显示弹框 确定
原文:https://www.cnblogs.com/wmsjh/p/13405041.html