'2013/12/31'에 해당되는 글 2건

  1. 2013.12.31 [javascript] 해당 년월의 마지막 날짜 구하기
  2. 2013.12.31 [jQuery] select box option control
javascript2013. 12. 31. 11:06
년도, 월 로 해당 월의 마지막 일을 구하는 함수.


function getLastDay(year, month)

{

if(month==4 || month==6 || month==9 || month==11)

return 30;

else if(month==2) //2월일때

{

if(year%4 == 0) // 2월이면서 윤년일 때

return 29;

else // 2월이면서 윤년이 아닐 때

return 28

}

else

return 31;

}



Posted by E.No
jQuery2013. 12. 31. 11:00

은근히 많이 쓰는데 또 은근히 자주 까먹는다.


// 지정된 index 값으로 select 하기

$("#selectBox option:eq(2)").attr("selected""selected");



전부 퍼오기 염치없으니.. 


보다 자세한 내용은 

http://blog.daum.net/twinsnow/124 


깔끔히 정리 잘해놓으셨다.

Posted by E.No