var td1x = prompt("输入学号:",""); var td2x = prompt("输入名字:",""); if(td1x!=null&&td2x!=null) { td1.innerHTML =td1x; td2.innerHTML =td2x; }
关键在这里
prompt("输入学号:",""); 改为:prompt("输入学号:',' ");