[CODE]<html>
<head>
<body><script language="javascript">
function ru(){
var year1=prompt("请输入年份","请输入一个年份");
var validate1 = new RegExp("[0-9]","g");
if(year1==null)
{
alert("欢迎再来!");
}
else{
if(validate1.test(year1)==true)
{
if(((year1%4==0)&& (year1%100!=0)) ||(year1%400==0))
{
alert("是闰年");
}
else {alert("不是闰年");}
}
else { alert("输入错误了");}
}
}
</script>
<input type="button" name="button1" value="请点击我一下" onClick="ru()"></body></head></html>[/CODE]