<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
a{
text-decoration: none;
}
ul{
list-style: none;
}
</style>
</head>
<body>
<select id="select" onblur = "fn()">
<option value="d">日</option>
<option value="m">月</option>
<option value="y">年</option>
</select>
<div id="mon"></div>
<!-- <input type="button" value="add" onblur = "fn()"> -->
<script>
function fn(){
var oMon = document.getElementById("mon");
var sel = document.getElementById("select").value;
switch(sel){
case "d":
oMon.innerHTML = "日";
break;
case "m":
oMon.innerHTML = "月";
break;
case "y":
oMon.innerHTML = "年";
break;
}
}
</script>
</body>
</html>
添加回答
举报
0/150
提交
取消