window.onload=function(){
phonenum=document.getElementById("phonenum1").value;
// var vphonenum=phonenum;
// alert(vphonenum);
// return false;
but=document.getElementById("but");
but.onclick=(function(){
if (phonenum ==="") {
alert("手机号码不能为空,请重新输入");
return false;
}else{
alert(phonenum);
}
});
} 这样写对吗?表单有值也会alert,没有值也会弹出alert
慕设计5951087
Caballarii
慕粉小玉儿
随时随地看视频慕课网APP