<html>
<head>
<script>
window.onload=function(){
b.onclick=function(){
var b=["일","월","화","수","목","금","토"];
var s=new Date(y.value,m.value-1,1);
con.innerHTML=y.value+"년"+m.value+"월"+"1일"+b[s.getDay()]+"요일";
}
}
</script>
</head>
<body>
<select id="y">
<script>
for(var a=1900; a<2050; a++){
document.write("<option>"+a+"</option>");
}
</script>
</select>년
<select id="m">
<script>
for(var a=1; a<13; a++){
document.write("<option>"+a+"</option>");
}
</script>
</select>월
<input type="button" id="b" value="달력보기">
<div id="con"></div>
</body>
</html>
'개발하자 > 자바스크립트' 카테고리의 다른 글
글자색 0.5초마다 변하기 (0) | 2015.02.17 |
---|---|
카운트시작과 멈춤 setTimeout(),clearTimeout() (0) | 2015.02.17 |
select option for문으로 생성하기 (0) | 2015.02.17 |
Date객체 이용하여 요일얻어오기 (0) | 2015.02.17 |
css명령어 overflow : scroll | hidden | auto | visible (0) | 2015.02.17 |