<html>
<head>
<script>
window.onload=function(){
b.onclick=function(){
var a=t1.value.split("-");
var str=a[0]+"년"+a[1]+"월"+a[2]+"일";
t2.value=str;
}
}
</script>
</head>
<body>
<input type="text" id="t1" value="2015-02-17"><br>
<input type="button" id="b" value=클릭><br>
<input type="text" id="t2">
</body>
</html>
'개발하자 > 자바스크립트' 카테고리의 다른 글
Date객체 이용하여 요일얻어오기 (0) | 2015.02.17 |
---|---|
css명령어 overflow : scroll | hidden | auto | visible (0) | 2015.02.17 |
문자열에서 파일명만 잘라내기 (0) | 2015.02.17 |
문자열관련 메서드 (0) | 2015.02.17 |
첫문자는 대문자 나머지는 소문자로 바꾸기 (0) | 2015.02.17 |