<script>
//..............................判断用户输入的年份是否是闰年.....................................
function getYear(){
var year=prompt("请输入年份");
if((year%4==0&&yeat%100!=0)||year%400==0){
alert("今年是闰年");
}else{
alert("今年不是闰年");
}
}
//.........................................米莱托指数.................................................................
function getWeight(){
var height=prompt("请您输入您的身高");
var weight=prompt("请您输入您的身高");
var calc=weight/(height*height);
if(calc>25){
alert("偏胖");
}else if(calc<20){
alert("偏瘦");
}else{
alert("标准体重");
}
}
</script>
<button onclick="getYear()"></button>